Owen Cavender 201159294

Dependencies:   mbed Gamepad2

snake.h

Committer:
el17oc
Date:
2020-05-27
Revision:
5:d716013c6a18
Parent:
2:44e4a6ecdbef
Child:
6:bf90044188d0

File content as of revision 5:d716013c6a18:


#ifndef SNAKE_H
#define SNAKE_H

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


class Snake
{


public:
    Snake();
    ~Snake();

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

    void init(GameEngine &engine);
    int set_direction(Gamepad &pad);
    //Directions get_direction();
    void move_snakebody(GameEngine &engine, N5110 &lcd);
    void gameover_true(N5110 &lcd);
    void check_scored(N5110 &lcd, Gamepad &pad, GameEngine &engine);
    void check_wall_collisions();
    //  void render(N5110 &lcd);
    void clear_applepos(N5110 &lcd);
  //  void draw_snake(Vector2D &_snakebody, N5110 &lcd);



private:

    bool _gameover;
    Directions _direction;
    int _length;
    int _score;
    Vector2D *_snakebody;
    Vector2D S0;
    Vector2D S1;
    

};


#endif