ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18ac

Dependencies:   mbed

Game/Game.h

Committer:
ale_carb0ni
Date:
2020-05-26
Revision:
6:a2c72def99f9
Parent:
4:17d5b53b8815
Child:
7:8d381315f72c

File content as of revision 6:a2c72def99f9:

#ifndef GAME_H
#define GAME_H

#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include <vector>
#include "Menu.h"

/** Game Class
* @brief controls the functioning of the game
* @author Alessandro Carboni
* @date Apr, 2020
*/

class Game
{

private:

    int x;
    int y;
    int fruitX [16];
    int fruitY [9];
    int score;
    int a;                              //used to select the direction based ont what button is pressed
    int ntail;                          //used to increase lenght of the tail
    int k;
    int rx;
    int ry;
    char buffer[10];
    int fruitX1;
    int fruitY1;
    vector <int> x_pos;
    vector <int> y_pos;

public:

    Game();

    void movement(Gamepad &pad);
    void updating_position();
    int death(N5110 &lcd,Gamepad &pad);
    void draw(N5110 &lcd,Gamepad &pad);
    void gameover(N5110 &lcd,Gamepad &pad);
    void point(N5110 &lcd,Gamepad &pad);
};

#endif