A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.
Dependencies: mbed MotionSensor
Diff: Room/Room.h
- Revision:
- 27:a1b41626f57c
- Parent:
- 26:abbc19edc5c1
- Child:
- 28:98848e6a77a2
--- a/Room/Room.h Mon Apr 29 02:45:17 2019 +0000 +++ b/Room/Room.h Mon Apr 29 10:39:09 2019 +0000 @@ -1,5 +1,6 @@ #ifndef ROOM_H #define ROOM_H +#include "sprites.h" #include "Entity.h" #include "Player.h" #include "Headless.h" @@ -11,19 +12,99 @@ class Room // contains the type of room, number of enemies inside it, the doorways existing in the room, functions to spawn enemies { private: + bool _doorways[4]; + int _type; + int _current_map[3][48][84]; + + // Functions + void overlap(int x, int y, int width, int height, int * object, int * map); public: // Constructors Room(); + // Deconstructors + ~Room(); + + // Accessors + int * get_current_map_2d(); // Functions void init(); - void spawn_enemies(); - void draw_enemies(N5110 &lcd); + void draw_room(N5110 &lcd); + void draw_room_overlay(N5110 &lcd); // Variables Entity *enemies[MAX_ENEMIES]; bool valid_enemies[MAX_ENEMIES]; }; +const int wall_x[2][11][3] = { // [E/W][Size_Y][Size_X] + { // E + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + {1,0,0}, + }, + { // W + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + {0,0,1}, + } +}; + +const int wall_n[2][10][12] = { // [2d/3d][Size_Y][Size_X] + { // N + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {1,1,1,1,1,1,1,1,1,1,1,1,}, + }, + { + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {1,1,1,1,1,1,1,1,1,1,1,1,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {1,1,1,1,1,1,1,1,1,1,1,1,}, + }, +}; + +const int wall_s[2][3][12] = { // [2d/3d][Size_Y][Size_X] + { + {1,1,1,1,1,1,1,1,1,1,1,1,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + }, + { + {1,1,1,1,1,1,1,1,1,1,1,1,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + {0,0,0,0,0,0,0,0,0,0,0,0,}, + }, +}; + #endif \ No newline at end of file