From 0bb88c799870b59da48835628484bb522f4bee2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Plante?= Date: Fri, 22 Dec 2017 00:52:00 -0500 Subject: [PATCH] Simple little changes To make the example more fun --- examples/SimpleRL/SimpleRL.ino | 51 ++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/examples/SimpleRL/SimpleRL.ino b/examples/SimpleRL/SimpleRL.ino index 7fe1201..b3e8cb3 100644 --- a/examples/SimpleRL/SimpleRL.ino +++ b/examples/SimpleRL/SimpleRL.ino @@ -21,20 +21,41 @@ BasicTerm term(&Serial); -#define MAP_COLS 10 -#define MAP_ROWS 10 - -uint8_t dungeon[] = "#### ####" - "# #### #" - "# #" - "## ##" - " # # " - " # # " - "## ##" - "# #" - "# #### #" - "#### ####"; - +#define MAP_COLS 32 +#define MAP_ROWS 32 +uint8_t dungeon[] = +"################################" +"# #" +"# ###f######################## #" +"# # ### #t # # #" +"# # ##### ### # ########m# #" +"# ### ###a# # # # # #=# #" +"# #d#t# # ### # # ## # # #" +"# # ### # ## ######## # ## # #" +"# #^### # # # # # ### #" +"# # #S# ## # # D # ####### # # #" +"# # # # # # # #" +"# ######## # ##^###### # ### # #" +"# #d#g # # # # # #d#h# #" +"# # #### #### # # # # ## # #t# #" +"# # g# # # #e# # # #" +"# ###S## #### # # #### ##### # #" +"# # ### #f # # # # # # #" +"# # ### ### # # # # # #### # # #" +"# # ### # # # # # #h S # # #" +"# # # # #S# # # # # ######## # #" +"# # # # # # # # #" +"# ### ################ # # # # #" +"# # # c# # # # #" +"# # #### ############# # # # # #" +"# # + # # #" +"# # ####t############### # # # #" +"# # F#b# # #r ### # #" +"# # ## # ### ### ### ### # ### #" +"# # #h #k # #h# # #" +"# ################## # ### ### #" +"# # #" +"################################"; struct mob { uint8_t y; uint8_t x; @@ -122,7 +143,7 @@ void draw_mob(void) { } void map_move(uint8_t y, uint8_t x) { - if(dungeon[(y) * MAP_COLS + (x)] == ' ') { + if(dungeon[(y) * MAP_COLS + (x)] != '#') { player.y = y; player.x = x; }