Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 36 additions & 15 deletions examples/SimpleRL/SimpleRL.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down