aboutsummaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-12-30 12:21:33 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-12-30 12:21:33 +0000
commit2307c68184744567d1c2d50bbbcd25a8dd2d0d02 (patch)
tree0e0dcd0e038c3564eddb6ae71114a8632a4048d5 /main.lua
parenta98a8b4506d4dc71b3342b15ae83c91a31090815 (diff)
downloadstorage-chaos-2307c68184744567d1c2d50bbbcd25a8dd2d0d02.tar.gz
storage-chaos-2307c68184744567d1c2d50bbbcd25a8dd2d0d02.zip
Slighly nicer render for space out of the map
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/main.lua b/main.lua
index 4ab7168..c3d1199 100644
--- a/main.lua
+++ b/main.lua
@@ -15,13 +15,13 @@ function love.load()
{ '#', '#', '#', '#', '#', '#', '#' }
},
{
- { '#','#','#','#','#','#',' ',' '},
- { '#',' ',' ',' ',' ','#','#','#'},
- { '#',' ','#',' ','$',' ',' ','#'},
- { '#','.','.','.','*','$','@','#'},
- { '#',' ','#',' ','$',' ',' ','#'},
- { '#',' ',' ',' ','#','#','#','#'},
- { '#','#','#','#','#',' ',' ',' '}
+ { '#', '#', '#', '#', '#', '#', 'x', 'x' },
+ { '#', ' ', ' ', ' ', ' ', '#', '#', '#' },
+ { '#', ' ', '#', ' ', '$', ' ', ' ', '#' },
+ { '#', '.', '.', '.', '*', '$', '@', '#' },
+ { '#', ' ', '#', ' ', '$', ' ', ' ', '#' },
+ { '#', ' ', ' ', ' ', '#', '#', '#', '#' },
+ { '#', '#', '#', '#', '#', 'x', 'x', 'x' }
}
}
@@ -271,8 +271,10 @@ function love.draw()
draw_x = 10 + x * 64
draw_y = 10 + y * 64
- -- always draw the ground
- love.graphics.draw(ground, draw_x, draw_y)
+ -- draw ground unless in empty
+ if cell ~= 'x' then
+ love.graphics.draw(ground, draw_x, draw_y)
+ end
if cell == '#' then
love.graphics.draw(wall, draw_x, draw_y)
elseif cell == '$' then