diff options
| author | jussi | 2024-02-14 21:46:29 +0200 |
|---|---|---|
| committer | jussi | 2024-02-14 21:46:29 +0200 |
| commit | 48adbe20dc022d286875408d215ef323c853e6f4 (patch) | |
| tree | 00877204265329e57446e92da879eeddbf5be4a9 /examples/snake | |
| parent | b8f27aefaedb7972fa0f1ff11b998aebdca4fb89 (diff) | |
| download | reilua-enhanced-48adbe20dc022d286875408d215ef323c853e6f4.tar.gz reilua-enhanced-48adbe20dc022d286875408d215ef323c853e6f4.tar.bz2 reilua-enhanced-48adbe20dc022d286875408d215ef323c853e6f4.zip | |
Logo.
Diffstat (limited to 'examples/snake')
| -rw-r--r-- | examples/snake/main.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/snake/main.lua b/examples/snake/main.lua index a4086c1..d9e5f5c 100644 --- a/examples/snake/main.lua +++ b/examples/snake/main.lua @@ -18,9 +18,9 @@ local monitorSize = Vec2:new( RL.GetMonitorSize( monitor ) ) local winScale = 6 local winSize = Vec2:new( RESOLUTION.x * winScale, RESOLUTION.y * winScale ) local gameState = STATE.GAME -local grassTexture = -1 -local snakeTexture = -1 -local appleTexture = -1 +local grassTexture = nil +local snakeTexture = nil +local appleTexture = nil local gameSpeed = 7.0 local moveTimer = 1.0 local snake = {} @@ -213,8 +213,7 @@ local function drawSnake() RL.DrawTexturePro( snakeTexture, { 24, 0, 8, 8 }, - { snake.headPos.x * TILE_SIZE + 4, - snake.headPos.y * TILE_SIZE + 4, 8, 8 }, + { snake.headPos.x * TILE_SIZE + 4, snake.headPos.y * TILE_SIZE + 4, 8, 8 }, { 4, 4 }, angle * RL.RAD2DEG, RL.WHITE |
