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.
DodgeEngine/DodgeEngine.h
- Committer:
- ll16o2l
- Date:
- 2019-04-25
- Revision:
- 8:c3153fd4d8ce
- Parent:
- 7:67c00839f188
- Child:
- 15:807eba7c7811
File content as of revision 8:c3153fd4d8ce:
#ifndef DODGENGINE_H
#define DODGEENGINE_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Objects.h"
#include "Player.h"
#include "Health_Kit.h"
/** DodgeEngine Class
* @author Oliver Luong, University of Leeds
* @brief Controls the functionality of the Dodge game
* @date 22/04/2019
*/
class DodgeEngine
{
public:
DodgeEngine();
~DodgeEngine();
void init(int player_width,int player_height,int objetcs_size,int speed,int lives, int kit_size);
void read_input(Gamepad &pad);
void update(Gamepad &pad);
void draw(N5110 &lcd);
void time(float time);
int get_lose();
private:
void check_wall_collision1(Gamepad &pad);
void check_wall_collision2(Gamepad &pad);
void check_wall_collision3(Gamepad &pad);
void check_wall_collision4(Gamepad &pad);
void check_player_collisions1(Gamepad &pad);
void check_player_collisions2(Gamepad &pad);
void check_player_collisions3(Gamepad &pad);
void check_player_collisions4(Gamepad &pad);
void check_player_health_kit_collison(Gamepad &pad);
void life_up(Gamepad &pad);
void life_leds(Gamepad &pad);
void player_hit(Gamepad &pad);
void print_lives_time(N5110 &lcd);
Player _player;
int _player_width;
int _player_height;
int _objects_size;
int _speed;
int lose;
int _lives;
int l; //counter for loop
int n; //counter for loop
int m; //counter for loop
float _time;
Objects _objects1;
Objects _objects2;
Objects _objects3;
Objects _objects4;
Direction _d;
float _mag;
Health_Kit _health_kit;
int _kit_size;
bool collect;
bool used;
};
#endif