Mochu Yao explorer game
Dependencies: mbed
Gameengine/Gameengine.h
- Committer:
- el17my
- Date:
- 2020-04-28
- Revision:
- 26:4d193529b447
- Parent:
- 23:7be9701fc1b8
- Child:
- 27:354d91d59b6d
File content as of revision 26:4d193529b447:
#ifndef GAMEENGINE_H #define GAMEENGINE_H #include "N5110.h" #include "mbed.h" #include "Gamepad.h" #include "item.h" #include "explorer.h" #include "surface.h" #include <cstdlib> #include <ctime> struct Coordinate { Vector2D coord; /**< Vector 2D for joystick coords */ }; class Gameengine { // Constructor and destructor. public: Gameengine(); ~Gameengine(); //first init all the parameter void init(); void reset_game_engine(); void read_input(Gamepad &pad); void check_reset(N5110 &lcd, Gamepad &gamepad); void check_collision(Gamepad &gamepad); void check_start(N5110 &lcd, Gamepad &gamepad); void set_fall_flag(); bool get_start_flag(); void generate_lines(); int get_score(); void get_explorer_direction(); void get_sprite(); void get_explorer_y(Gamepad &gamepad); void get_explorer_x(); void update_lcd(N5110 &lcd); void run_engine(N5110 &lcd, Gamepad &gamepad); private: Coordinate _coordinate; item _item; Explorer _player; Surface _surface; bool X_flag; int _player_x; int _player_y; bool _collision_flag; bool _f_flag; bool _r_flag; bool _start_flag; int _speed; int _jump_height; int _player_score; Line set_line_1; Line set_line_2; Line set_line_3; Line line_1_value; Line line_2_value; Line line_3_value; Line line_4_value; Line line_5_value; Line line_6_value; Player_direction _player_direction; Explorer_sprite _explorer_sprite; }; #endif