From 2307c68184744567d1c2d50bbbcd25a8dd2d0d02 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 30 Dec 2023 12:21:33 +0000 Subject: Slighly nicer render for space out of the map --- main.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'main.lua') 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 -- cgit v1.2.3