A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.
Dependencies: mbed MotionSensor
Diff: RoomEngine/RoomEngine.h
- Revision:
- 28:98848e6a77a2
- Parent:
- 27:a1b41626f57c
- Child:
- 29:6b8411bb040a
diff -r a1b41626f57c -r 98848e6a77a2 RoomEngine/RoomEngine.h --- a/RoomEngine/RoomEngine.h Mon Apr 29 10:39:09 2019 +0000 +++ b/RoomEngine/RoomEngine.h Thu May 02 21:30:49 2019 +0000 @@ -1,27 +1,31 @@ #ifndef ROOMENGINE_H #define ROOMENGINE_H +#include "N5110.h" #include "Player.h" #include "Bullets.h" #include "Room.h" #include "Gamepad.h" #include "sprites.h" +#include "Health.h" class RoomEngine { public: RoomEngine(); ~RoomEngine(); - void load_room(Room ¤t_room); + void init(Player ¤t_player, Room ¤t_room); + void save_room(Room ¤t_room); + void entrance_scene(N5110 &lcd, Gamepad &gamepad); + void exit_scene(N5110 &lcd, Gamepad &gamepad); void read_input(Gamepad &gamepad); void update(); void render(N5110 &lcd, Gamepad &gamepad); bool check_player_death(); + int check_player_room_position(); private: bool _L; bool _R; - bool _START; - bool _BACK; bool _A; bool _B; bool _X; @@ -31,15 +35,27 @@ Room *room; Player *player; + // Mutator + void set_input(bool L, bool R, bool A, bool B, bool X, bool Y, float mapped_x, float mapped_y); + void set_mapped_coord(float x, float y); + // Functions + bool entity_collision(Entity &a, Entity &b); + float entity_move_check_x(Entity *a, Entity *array[], int no_of_enemies, int current_entity, bool valid_enemies[]); + float entity_move_check_y(Entity *a, Entity *array[], int no_of_enemies, int current_entity, bool valid_enemies[]); + void check_damage(); void check_damage_player(); void check_damage_enemies(); + void check_damage_enemies_by_bullets(); + void check_damage_enemies_by_collisions(); void check_enemies_death(); void move(); void move_player(); void move_enemies(); void move_bullets(); + void update_player_position(int side); + void minimap_detection(N5110 &lcd, Gamepad &gamepad); void pause_detection(N5110 &lcd, Gamepad &gamepad); @@ -49,8 +65,5 @@ void draw_bullets(N5110 &lcd); void draw_health(N5110 &lcd); - bool entity_collision(Entity &a, Entity &b); - float entity_move_check_x(Entity *a, Entity *array[], int no_of_enemies, int current_entity, bool valid_enemies[]); - float entity_move_check_y(Entity *a, Entity *array[], int no_of_enemies, int current_entity, bool valid_enemies[]); }; #endif \ No newline at end of file