A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.

Dependencies:   mbed MotionSensor

Revision:
30:ec915d24d3e9
Parent:
29:6b8411bb040a
Child:
32:fe6359ef9916
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RoomEngine/Room/Room.h	Sun May 05 18:04:43 2019 +0000
@@ -0,0 +1,95 @@
+#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:
+    bool _doorways[4];
+    int _room_type;
+    int _enemy_coord[MAX_ENEMIES][2]; //  _enemy_coord[EnemyID][x/y]
+    
+    // Functions
+    void draw_walls(N5110 &lcd);
+    void draw_walls_overlay(N5110 &lcd);
+    
+public:
+    // Constructors
+    Room(int no_of_enemies);
+    // Deconstructors
+    ~Room();
+    
+    // Accessors
+    int * get_current_map_2d();
+    bool * get_doorways();
+    
+    // Functions
+    void load();
+    void unload();
+    void draw_room(N5110 &lcd);
+    void draw_room_overlay(N5110 &lcd);
+    
+    // Variables
+    Entity *enemies[MAX_ENEMIES];
+    bool valid_enemies[MAX_ENEMIES];
+    int enemies_type[MAX_ENEMIES];
+};
+
+const int wall_x[2][11][3] = { // [E/W][Size_Y][Size_X]
+    {   // E
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+        {1,2,2},
+    },
+    {   // W
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,1},
+        {2,2,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[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