Joe Shotton / Mbed 2 deprecated ELEC2645_Project_ll16j23s

Dependencies:   mbed ll16j23s_test_docs

Committer:
JoeShotton
Date:
Mon May 25 14:45:32 2020 +0000
Revision:
8:bcc3403d7e79
Parent:
7:dd84e0fab346
Child:
9:0571880085cc
Added contrast adjustments for all menu states

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