Owen Cavender 201159294

Dependencies:   mbed Gamepad2

snake.h

Committer:
el17oc
Date:
2020-05-28
Revision:
6:bf90044188d0
Parent:
5:d716013c6a18
Child:
8:997f90c88246

File content as of revision 6:bf90044188d0:


#ifndef SNAKE_H
#define SNAKE_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Apple.h"


class Snake
{


public:
    Snake();
    ~Snake();

    enum Directions {
        up,
        down,
        left,
        right,
        null
    };

    void init();


    void check_collisions();
    void check_score(N5110 &lcd, Gamepad &pad, Apple &apple, Timer &timer);




    void get_position(Gamepad &pad);
    void render(N5110 &lcd, Apple &apple);
    void get_LEDs(Gamepad &pad);
    void get_timer(Timer &timer);
    bool get_gameover();
    int get_score();
    void print_scores(N5110 &lcd);
    void print_display_time(N5110 &lcd);



private:

    bool _gameover;
    Directions _direction;
    int _score;

    float _realtime;
    int Reset_value;
    float _display_time;


    int _x0;
    int _x1;
    int _x2;
    int _x3;

    int _y0;
    int _y1;
    int _y2;
    int _y3;

//Vector2D SK0;
//Vector2D SK1;
//Vector2D SK2;
//Vector2D SK3;

};


#endif