ELEC2645 (2017/18) / Mbed 2 deprecated ll14zs

Dependencies:   mbed

Fork of ll14zs by Zeshaan Saeed

DashEngine/DashEngine.h

Committer:
ll14zs
Date:
2018-05-24
Revision:
3:1231a3961984
Parent:
2:5d3aac7fd3df

File content as of revision 3:1231a3961984:

/**
@brief Dash Engine class
@author Zeshaan Saeed
@date May 2018
*/

#ifndef DASHENGINE_H
#define DASHENGINE_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Car.h"
#include "Level.h"
#include <vector>

class DashEngine
{
public:
    DashEngine();
    ~DashEngine();
    
    void init(int car_width,int car_height,int _x,int _y,int level_height);
    void read_input(Gamepad &pad);
    void update(Gamepad &pad,N5110 &lcd);
    void draw(N5110 &lcd,Gamepad &pad);
    
private:

    void initDisplay();

    void score_timer(Gamepad &pad);

    void addLevel();

    void check_wall_collision(Gamepad & pad);

    void check_level_collisions(N5110 &lcd,Gamepad &pad);

    void check_gameover(N5110 & lcd,Gamepad & pad);

    vector<Level*> LevelVectors;

    Vector2D level_pos;

    Vector2D level_velocity;
    
    //Game Parameters 
    int _car_width;
    int _car_height;
    int _car_x;
    int _car_y;
    int _level_height;
    int _speed;
    
    int levelcollision;
    int counter;
    
    //Objects
    Level _Level;
    Car _car;
    Direction _d;

};
    //Ticker
    void scoreTicker_isr();

#endif