Skip to content

Commit

Permalink
Merge pull request #2 from julianthome/position
Browse files Browse the repository at this point in the history
Position fix
  • Loading branch information
julianthome authored May 28, 2023
2 parents 5443a10 + ac8383f commit cb2be90
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Dieses Spiel benötigt eine funktionierenden Lua Interpreter und LÖVE Installat

Anschließend können sie das Spiel mittels `./run.sh` starten

In [diesem Golem.de Artikel](https://www.golem.de/news/spieleklassiker-snake-programmieren-mit-lua-und-loeve-2305-174483.html) ist der Code im Detail erläutert.

### Lizenz

Der gesamte Source-Code in diesem Verzeichnis ist unter der [MIT Lizenz lizenziert](./LICENSE.md).
Expand Down
2 changes: 2 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This game assumes working installations of Lua and LÖVE to be present. You can

Afterwards you should be able to start the game by just invoking `./run.sh` from this directory.

[This Golem.de article](https://www.golem.de/news/spieleklassiker-snake-programmieren-mit-lua-und-loeve-2305-174483.html) explains implementation in detail.

### Documentation.

See [POST.md](./POST.md) for more details.
Expand Down
Binary file removed game_screenshot.png
Binary file not shown.
Binary file removed grid.png
Binary file not shown.
Binary file removed grid_screenshot.png
Binary file not shown.
Binary file removed init_screenshot.png
Binary file not shown.
4 changes: 2 additions & 2 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ function update_pos(dir, segment)
if segment.pos_y < 0 then
segment.pos_y = board.x_dim
elseif segment.pos_y > board.y_dim then
segment.pos_y = 1
segment.pos_y = 0
end

if segment.pos_x < 0 then
segment.pos_x = board.x_dim
elseif segment.pos_x > board.x_dim then
segment.pos_x = 1
segment.pos_x = 0
end
end

Expand Down

0 comments on commit cb2be90

Please sign in to comment.