ELEC2645 (2018/19) / Mbed 2 deprecated ll16o2l_ELEC2645

Dependencies:   mbed Gamepad

DodgeEngine/DodgeEngine.h

Committer:
ll16o2l
Date:
2019-04-25
Revision:
7:67c00839f188
Parent:
6:98ddf5eade49
Child:
8:c3153fd4d8ce

File content as of revision 7:67c00839f188:

#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();
    
    /// This method will be used to set the global variables to local variable
    /// @param player_width, player_height, objects_size, speed, lives, kit_size
    void init(int player_width,int player_height,int objetcs_size,int speed,int lives, int kit_size);
    /// This method will be used to execute methods from Gamepad and store the returned variables
    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