A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.
Dependencies: mbed MotionSensor
main.h@46:f09711580d4a, 2019-05-08 (annotated)
- Committer:
- el17sm
- Date:
- Wed May 08 20:47:52 2019 +0000
- Revision:
- 46:f09711580d4a
- Child:
- 47:6e31b195ce3c
Map Generation Done
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17sm | 46:f09711580d4a | 1 | #ifndef MAIN_H |
el17sm | 46:f09711580d4a | 2 | #define MAIN_H |
el17sm | 46:f09711580d4a | 3 | |
el17sm | 46:f09711580d4a | 4 | // Pre-Processor |
el17sm | 46:f09711580d4a | 5 | #include "mbed.h" |
el17sm | 46:f09711580d4a | 6 | #include "Gamepad.h" |
el17sm | 46:f09711580d4a | 7 | #include "N5110.h" |
el17sm | 46:f09711580d4a | 8 | #include "math.h" |
el17sm | 46:f09711580d4a | 9 | #include "sprites.h" |
el17sm | 46:f09711580d4a | 10 | #include "Entity.h" |
el17sm | 46:f09711580d4a | 11 | #include "Player.h" |
el17sm | 46:f09711580d4a | 12 | #include "Headless.h" |
el17sm | 46:f09711580d4a | 13 | #include "Snake.h" |
el17sm | 46:f09711580d4a | 14 | #include "RoomEngine.h" |
el17sm | 46:f09711580d4a | 15 | #include "Title.h" |
el17sm | 46:f09711580d4a | 16 | |
el17sm | 46:f09711580d4a | 17 | #define INSIDE 4 |
el17sm | 46:f09711580d4a | 18 | |
el17sm | 46:f09711580d4a | 19 | // Variables |
el17sm | 46:f09711580d4a | 20 | float global_contrast = 0.5; |
el17sm | 46:f09711580d4a | 21 | int boss_room_number; |
el17sm | 46:f09711580d4a | 22 | bool boss_room_exist; |
el17sm | 46:f09711580d4a | 23 | int no_of_doorways; |
el17sm | 46:f09711580d4a | 24 | int boss_room_counter = 0; |
el17sm | 46:f09711580d4a | 25 | int prev_room_x = MAX_ROOMS_MAP_X; |
el17sm | 46:f09711580d4a | 26 | int prev_room_y = MAX_ROOMS_MAP_Y; |
el17sm | 46:f09711580d4a | 27 | int room_x = MAX_ROOMS_MAP_X; |
el17sm | 46:f09711580d4a | 28 | int room_y = MAX_ROOMS_MAP_Y; |
el17sm | 46:f09711580d4a | 29 | bool have_to[4] = {false, false, false, false}; |
el17sm | 46:f09711580d4a | 30 | bool cannot[4] = {false, false, false, false}; |
el17sm | 46:f09711580d4a | 31 | Player *player; |
el17sm | 46:f09711580d4a | 32 | Room *rooms[MAX_ROOMS_MAP_Y][MAX_ROOMS_MAP_X]; |
el17sm | 46:f09711580d4a | 33 | bool valid_rooms[MAX_ROOMS_MAP_Y][MAX_ROOMS_MAP_X]; |
el17sm | 46:f09711580d4a | 34 | RoomEngine *room_engine; |
el17sm | 46:f09711580d4a | 35 | |
el17sm | 46:f09711580d4a | 36 | // Objects |
el17sm | 46:f09711580d4a | 37 | N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); |
el17sm | 46:f09711580d4a | 38 | Gamepad gamepad; |
el17sm | 46:f09711580d4a | 39 | Title title; |
el17sm | 46:f09711580d4a | 40 | |
el17sm | 46:f09711580d4a | 41 | // Prototypes |
el17sm | 46:f09711580d4a | 42 | void init(); |
el17sm | 46:f09711580d4a | 43 | void game_loop(); |
el17sm | 46:f09711580d4a | 44 | void game_over(); |
el17sm | 46:f09711580d4a | 45 | void generate_room(); |
el17sm | 46:f09711580d4a | 46 | void update_room_coords(); |
el17sm | 46:f09711580d4a | 47 | |
el17sm | 46:f09711580d4a | 48 | int opposite(int value); |
el17sm | 46:f09711580d4a | 49 | int count_doorways(); |
el17sm | 46:f09711580d4a | 50 | void update_definite_doorways(); |
el17sm | 46:f09711580d4a | 51 | int available_boss_room(); |
el17sm | 46:f09711580d4a | 52 | void minimap_detection(); |
el17sm | 46:f09711580d4a | 53 | |
el17sm | 46:f09711580d4a | 54 | #endif |