Joe Shotton / Mbed 2 deprecated ELEC2645_Project_ll16j23s

Dependencies:   mbed ll16j23s_test_docs

Committer:
JoeShotton
Date:
Mon May 25 20:31:52 2020 +0000
Revision:
9:0571880085cc
Parent:
8:bcc3403d7e79
Child:
10:a2d643b3c782
Post death menus partially implemented, mostly fixed food location issues and issues with tail display

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JoeShotton 4:ea3fa51c4386 1 #ifndef SNAKEENGINE_H
JoeShotton 4:ea3fa51c4386 2 #define SNAKEENGINE_H
JoeShotton 3:fcd6d70e9694 3
JoeShotton 3:fcd6d70e9694 4 #include "mbed.h"
JoeShotton 3:fcd6d70e9694 5 #include "N5110.h"
JoeShotton 3:fcd6d70e9694 6 #include "Gamepad.h"
JoeShotton 3:fcd6d70e9694 7 #include "FXOS8700CQ.h"
JoeShotton 7:dd84e0fab346 8 #include "Bitmap.h"
JoeShotton 3:fcd6d70e9694 9 #include "SnakeBody.h"
JoeShotton 3:fcd6d70e9694 10 #include "Food.h"
JoeShotton 3:fcd6d70e9694 11 #include <vector>
JoeShotton 3:fcd6d70e9694 12
JoeShotton 3:fcd6d70e9694 13 class SnakeEngine
JoeShotton 3:fcd6d70e9694 14 {
JoeShotton 3:fcd6d70e9694 15
JoeShotton 3:fcd6d70e9694 16 public:
JoeShotton 3:fcd6d70e9694 17 SnakeEngine();
JoeShotton 3:fcd6d70e9694 18 ~SnakeEngine();
JoeShotton 4:ea3fa51c4386 19
JoeShotton 7:dd84e0fab346 20 void welcome(N5110 &lcd);
JoeShotton 7:dd84e0fab346 21
JoeShotton 9:0571880085cc 22 void menu1_init(Gamepad &pad, N5110 &lcd);
JoeShotton 9:0571880085cc 23 void menu1_select(N5110 &lcd, Gamepad &pad, FXOS8700CQ &mag);
JoeShotton 7:dd84e0fab346 24
JoeShotton 9:0571880085cc 25 void menu2_init(Gamepad &pad, N5110 &lcd);
JoeShotton 7:dd84e0fab346 26 void menu2_select(N5110 &lcd, Gamepad &pad);
JoeShotton 7:dd84e0fab346 27
JoeShotton 7:dd84e0fab346 28 void game_init(Gamepad &pad, N5110 &lcd, FXOS8700CQ &mag);
JoeShotton 7:dd84e0fab346 29 void game_run(Gamepad &pad, N5110 &lcd);
JoeShotton 7:dd84e0fab346 30
JoeShotton 9:0571880085cc 31 void death_init(Gamepad &pad, N5110 &lcd);
JoeShotton 9:0571880085cc 32 void death_select(N5110 &lcd, Gamepad &pad, FXOS8700CQ &mag);
JoeShotton 7:dd84e0fab346 33
JoeShotton 7:dd84e0fab346 34 //void init(FXOS8700CQ &mag);
JoeShotton 7:dd84e0fab346 35
JoeShotton 6:6c9453397f4a 36 void transition_black(N5110 &lcd);
JoeShotton 6:6c9453397f4a 37 void transition_white(N5110 &lcd);
JoeShotton 7:dd84e0fab346 38 void select_circles(N5110 &lcd, int line);
JoeShotton 9:0571880085cc 39 void preview(Gamepad &pad, N5110 &lcd, int _map_select);
JoeShotton 8:bcc3403d7e79 40 void map2_draw(N5110 &lcd);
JoeShotton 8:bcc3403d7e79 41 void map3_draw(N5110 &lcd);
JoeShotton 8:bcc3403d7e79 42 void map4_draw(N5110 &lcd);
JoeShotton 8:bcc3403d7e79 43
JoeShotton 8:bcc3403d7e79 44 void contrast(Gamepad &pad, N5110 &lcd_);
JoeShotton 7:dd84e0fab346 45
JoeShotton 7:dd84e0fab346 46 int score;
JoeShotton 7:dd84e0fab346 47 int _game_state;
JoeShotton 3:fcd6d70e9694 48
JoeShotton 3:fcd6d70e9694 49 //void init(VARIABLES);
JoeShotton 3:fcd6d70e9694 50 //void update(Gamepad &pad);
JoeShotton 3:fcd6d70e9694 51 //void draw(N5110 &lcd);
JoeShotton 3:fcd6d70e9694 52
JoeShotton 3:fcd6d70e9694 53 private:
JoeShotton 3:fcd6d70e9694 54
JoeShotton 4:ea3fa51c4386 55 SnakeBody _body;
JoeShotton 4:ea3fa51c4386 56 Food _food;
JoeShotton 4:ea3fa51c4386 57
JoeShotton 7:dd84e0fab346 58 //bool _game = true;
JoeShotton 8:bcc3403d7e79 59 void snake_food_collision(Gamepad &pad, N5110 &lcd, int &_length);
JoeShotton 8:bcc3403d7e79 60 void map_run(N5110 &lcd);
JoeShotton 9:0571880085cc 61 void snake_map2_collision();
JoeShotton 9:0571880085cc 62 void snake_map3_collision();
JoeShotton 9:0571880085cc 63 void snake_map4_collision();
JoeShotton 9:0571880085cc 64 void menu_flash(Gamepad &pad, int led);
JoeShotton 7:dd84e0fab346 65 float _angle;
JoeShotton 7:dd84e0fab346 66 int _menu_select;
JoeShotton 9:0571880085cc 67 int _map_select;
JoeShotton 8:bcc3403d7e79 68 float _pot2;
JoeShotton 9:0571880085cc 69 bool _death;
JoeShotton 9:0571880085cc 70
JoeShotton 9:0571880085cc 71 int spots_x[];
JoeShotton 9:0571880085cc 72 int spots_y[];
JoeShotton 3:fcd6d70e9694 73
JoeShotton 7:dd84e0fab346 74 //Bitmap snake_select1(snake_select1, 8, 8);
JoeShotton 7:dd84e0fab346 75 //Bitmap snake_select2(snake_select2, 16, 8);
JoeShotton 7:dd84e0fab346 76 //Bitmap snake_select3(snake_select3, 24, 8);
JoeShotton 3:fcd6d70e9694 77
JoeShotton 3:fcd6d70e9694 78 };
JoeShotton 3:fcd6d70e9694 79
JoeShotton 3:fcd6d70e9694 80 #endif