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

Dependencies:   mbed MotionSensor

Committer:
el17sm
Date:
Thu May 09 02:46:44 2019 +0000
Revision:
48:f7d9ae3e554d
Parent:
47:6e31b195ce3c
Child:
49:3f83ed62d123
Cleaned Main and title

Who changed what in which revision?

UserRevisionLine numberNew 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 47:6e31b195ce3c 23 int number_of_enemies_killed;
el17sm 47:6e31b195ce3c 24 int total_time;
el17sm 46:f09711580d4a 25 int no_of_doorways;
el17sm 46:f09711580d4a 26 int boss_room_counter = 0;
el17sm 46:f09711580d4a 27 int prev_room_x = MAX_ROOMS_MAP_X;
el17sm 46:f09711580d4a 28 int prev_room_y = MAX_ROOMS_MAP_Y;
el17sm 46:f09711580d4a 29 int room_x = MAX_ROOMS_MAP_X;
el17sm 46:f09711580d4a 30 int room_y = MAX_ROOMS_MAP_Y;
el17sm 46:f09711580d4a 31 bool have_to[4] = {false, false, false, false};
el17sm 46:f09711580d4a 32 bool cannot[4] = {false, false, false, false};
el17sm 46:f09711580d4a 33 Player *player;
el17sm 46:f09711580d4a 34 Room *rooms[MAX_ROOMS_MAP_Y][MAX_ROOMS_MAP_X];
el17sm 46:f09711580d4a 35 bool valid_rooms[MAX_ROOMS_MAP_Y][MAX_ROOMS_MAP_X];
el17sm 46:f09711580d4a 36 RoomEngine *room_engine;
el17sm 46:f09711580d4a 37
el17sm 46:f09711580d4a 38 // Objects
el17sm 46:f09711580d4a 39 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
el17sm 46:f09711580d4a 40 Gamepad gamepad;
el17sm 46:f09711580d4a 41 Title title;
el17sm 46:f09711580d4a 42
el17sm 46:f09711580d4a 43 // Prototypes
el17sm 46:f09711580d4a 44 void init();
el17sm 46:f09711580d4a 45 void game_loop();
el17sm 48:f7d9ae3e554d 46
el17sm 48:f7d9ae3e554d 47 void room_entrance();
el17sm 48:f7d9ae3e554d 48 void room_exit();
el17sm 48:f7d9ae3e554d 49 void generate_room();
el17sm 48:f7d9ae3e554d 50 void update_room_coords();
el17sm 48:f7d9ae3e554d 51 void minimap_detection();
el17sm 48:f7d9ae3e554d 52
el17sm 46:f09711580d4a 53 void game_over();
el17sm 47:6e31b195ce3c 54 void win();
el17sm 47:6e31b195ce3c 55 void display_stats();
el17sm 48:f7d9ae3e554d 56 void game_unload();
el17sm 46:f09711580d4a 57
el17sm 46:f09711580d4a 58 int opposite(int value);
el17sm 46:f09711580d4a 59 int count_doorways();
el17sm 46:f09711580d4a 60 void update_definite_doorways();
el17sm 46:f09711580d4a 61 int available_boss_room();
el17sm 46:f09711580d4a 62
el17sm 46:f09711580d4a 63 #endif