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:
- 29:6b8411bb040a
- Parent:
- 28:98848e6a77a2
diff -r 98848e6a77a2 -r 6b8411bb040a Room/Room.h --- a/Room/Room.h Thu May 02 21:30:49 2019 +0000 +++ b/Room/Room.h Sat May 04 15:39:20 2019 +0000 @@ -1,26 +1,28 @@ #ifndef ROOM_H #define ROOM_H #include "sprites.h" + #include "Entity.h" #include "Player.h" #include "Headless.h" #include "Snake.h" + #include "N5110.h" #define MAX_ENEMIES 10 class Room // contains the type of room, number of enemies inside it, the doorways existing in the room, functions to spawn enemies { - private: +private: bool _doorways[4]; int _room_type; - int _current_map[3][48][84]; + int _enemy_coord[MAX_ENEMIES][2]; // _enemy_coord[EnemyID][x/y] // Functions - void overlap(int x, int y, int width, int height, int * object, int * map); - void overlap_wall(int side); + void draw_walls(N5110 &lcd); + void draw_walls_overlay(N5110 &lcd); - public: +public: // Constructors Room(int no_of_enemies); // Deconstructors @@ -28,6 +30,7 @@ // Accessors int * get_current_map_2d(); + bool * get_doorways(); // Functions void load(); @@ -70,44 +73,23 @@ } }; -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_n[10][12] = { // [Size_Y][Size_X] + {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,}, - {2,2,2,2,2,2,2,2,2,2,2,2,}, - {2,2,2,2,2,2,2,2,2,2,2,2,}, - }, +const int wall_s[3][12] = { // [Size_Y][Size_X] + {1,1,1,1,1,1,1,1,1,1,1,1,}, + {2,2,2,2,2,2,2,2,2,2,2,2,}, + {2,2,2,2,2,2,2,2,2,2,2,2,}, }; #endif \ No newline at end of file