Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukinoko-kun committed Jan 7, 2024
1 parent a9bcffb commit 82824b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/game/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func main() {
}

escDown := false

// game loop
for core.Running() {
if core.KeyStates()[sdl.SCANCODE_ESCAPE] != 0 {
Expand Down
2 changes: 2 additions & 0 deletions engine/level/level.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ var (
}
)

// Set sets the current level.
func Set(level *Level) {
currentLevel = level
currentLevelWidth = int(level.Width)
currentLevelHeight = int(level.Height)
}

// Load reads a level from the given path.
func Load(path string) (*Level, error) {
b, err := os.ReadFile(path)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions engine/textures/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
colorTextures = make([]*sdl.Texture, 0xffffff)
)

// Register adds a texture to the registry to be used later.
func Register(texturepath string, key Key) *Texture {
t := unregistered(texturepath)

Expand Down

0 comments on commit 82824b5

Please sign in to comment.