Owen Cavender 201159294

Dependencies:   mbed Gamepad2

Committer:
el17oc
Date:
Sat May 30 02:31:43 2020 +0000
Revision:
14:7fb3c93343b6
Parent:
12:60c856354406
Child:
16:9500059ad5d8
ff

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17oc 1:897160a1a3ae 1
el17oc 1:897160a1a3ae 2 #ifndef SNAKE_H
el17oc 1:897160a1a3ae 3 #define SNAKE_H
el17oc 1:897160a1a3ae 4
el17oc 1:897160a1a3ae 5 #include "mbed.h"
el17oc 1:897160a1a3ae 6 #include "N5110.h"
el17oc 1:897160a1a3ae 7 #include "Gamepad.h"
el17oc 1:897160a1a3ae 8
el17oc 1:897160a1a3ae 9
el17oc 1:897160a1a3ae 10 class Snake
el17oc 1:897160a1a3ae 11 {
el17oc 1:897160a1a3ae 12
el17oc 1:897160a1a3ae 13
el17oc 1:897160a1a3ae 14 public:
el17oc 1:897160a1a3ae 15 Snake();
el17oc 1:897160a1a3ae 16 ~Snake();
el17oc 1:897160a1a3ae 17
el17oc 1:897160a1a3ae 18 enum Directions {
el17oc 1:897160a1a3ae 19 up,
el17oc 1:897160a1a3ae 20 down,
el17oc 1:897160a1a3ae 21 left,
el17oc 1:897160a1a3ae 22 right,
el17oc 1:897160a1a3ae 23 null
el17oc 1:897160a1a3ae 24 };
el17oc 1:897160a1a3ae 25
el17oc 6:bf90044188d0 26 void init();
el17oc 9:a69a6a06dddf 27 void render_clear_tail(N5110 &lcd);
el17oc 8:997f90c88246 28 void get_direction(Gamepad &pad);
el17oc 8:997f90c88246 29 void move_snake();
el17oc 14:7fb3c93343b6 30 void apple_collected(N5110 &lcd, Gamepad &pad);
el17oc 14:7fb3c93343b6 31 void check_gameover(N5110 &lcd);
el17oc 8:997f90c88246 32 void render(N5110 &lcd);
el17oc 14:7fb3c93343b6 33 // void print_display_time(N5110 &lcd);
el17oc 8:997f90c88246 34
el17oc 14:7fb3c93343b6 35
el17oc 8:997f90c88246 36 Vector2D get_Snakehead();
el17oc 12:60c856354406 37 int set_reset_value();
el17oc 12:60c856354406 38 int get_reset_value();
el17oc 12:60c856354406 39 bool get_timer_reset();
el17oc 12:60c856354406 40 bool get_RST();
el17oc 12:60c856354406 41 int get_countdown();
el17oc 14:7fb3c93343b6 42
el17oc 14:7fb3c93343b6 43 void gameover_true(N5110 &lcd, Gamepad &pad);
el17oc 12:60c856354406 44 void get_Apple_position(N5110 &lcd);
el17oc 14:7fb3c93343b6 45 int get_score();
el17oc 14:7fb3c93343b6 46
el17oc 14:7fb3c93343b6 47 private:
el17oc 1:897160a1a3ae 48
el17oc 1:897160a1a3ae 49
el17oc 14:7fb3c93343b6 50 bool get_gameover();
el17oc 14:7fb3c93343b6 51
el17oc 14:7fb3c93343b6 52
el17oc 14:7fb3c93343b6 53
el17oc 12:60c856354406 54 int _countdown;
el17oc 1:897160a1a3ae 55 bool _gameover;
el17oc 1:897160a1a3ae 56 Directions _direction;
el17oc 1:897160a1a3ae 57 int _score;
el17oc 14:7fb3c93343b6 58 // float _display_time;
el17oc 12:60c856354406 59 int _reset_apple;
el17oc 12:60c856354406 60 int _reset_value;
el17oc 14:7fb3c93343b6 61
el17oc 6:bf90044188d0 62
el17oc 6:bf90044188d0 63
el17oc 6:bf90044188d0 64 int _x0;
el17oc 14:7fb3c93343b6 65 int _y0;
el17oc 6:bf90044188d0 66 int _x1;
el17oc 14:7fb3c93343b6 67 int _y1;
el17oc 6:bf90044188d0 68 int _x2;
el17oc 14:7fb3c93343b6 69 int _y2;
el17oc 6:bf90044188d0 70 int _x3;
el17oc 14:7fb3c93343b6 71 int _y3;
el17oc 12:60c856354406 72 int _x4;
el17oc 14:7fb3c93343b6 73 int _y4;
el17oc 12:60c856354406 74 int _x5;
el17oc 14:7fb3c93343b6 75 int _y5;
el17oc 14:7fb3c93343b6 76 int _x6;
el17oc 14:7fb3c93343b6 77 int _y6;
el17oc 14:7fb3c93343b6 78 int _x7;
el17oc 14:7fb3c93343b6 79 int _y7;
el17oc 6:bf90044188d0 80
el17oc 14:7fb3c93343b6 81
el17oc 14:7fb3c93343b6 82
el17oc 14:7fb3c93343b6 83
el17oc 9:a69a6a06dddf 84 int _apx;
el17oc 9:a69a6a06dddf 85 int _apy;
el17oc 14:7fb3c93343b6 86
el17oc 12:60c856354406 87
el17oc 6:bf90044188d0 88
el17oc 6:bf90044188d0 89 //Vector2D SK0;
el17oc 6:bf90044188d0 90 //Vector2D SK1;
el17oc 6:bf90044188d0 91 //Vector2D SK2;
el17oc 6:bf90044188d0 92 //Vector2D SK3;
el17oc 1:897160a1a3ae 93
el17oc 1:897160a1a3ae 94 };
el17oc 1:897160a1a3ae 95
el17oc 1:897160a1a3ae 96
el17oc 1:897160a1a3ae 97 #endif