Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Engine/Engine.h
- Committer:
- lewisgw
- Date:
- 2019-03-19
- Revision:
- 6:8741d2011692
- Parent:
- 5:eda40cdde3e7
- Child:
- 7:bbc2b75c1418
File content as of revision 6:8741d2011692:
/** Engine Class
* @brief Handles the game mechanics in a game engine: reads inputs, updates game and LCD * @author Lewis Wooltorton
* @date March 2019
*/
#ifndef ENGINE_H
#define ENGINE_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Skateboarder.h"
struct Input {
Vector2D coord;
bool A_flag;
};
class Engine {
public:
Engine();
~Engine();
void init();
void read_input(Gamepad &gamepad);
void find_level();
void process_y();
void process_x();
void process_sprite();
void update_lcd(N5110 &lcd);
private:
Skateboarder _skater;
Input _input;
int _moving_counter;
int _jump_counter;
int _x;
int _y;
int _level;
Skate_Direction _direction;
Sprite_value _sprite;
int* _skate_sprite;
};
#endif