Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed ll16j23s_test_docs
Diff: SnakeEngine/SnakeEngine.h
- Revision:
- 7:dd84e0fab346
- Parent:
- 6:6c9453397f4a
- Child:
- 8:bcc3403d7e79
--- a/SnakeEngine/SnakeEngine.h Sat May 23 20:01:00 2020 +0000
+++ b/SnakeEngine/SnakeEngine.h Sun May 24 22:18:55 2020 +0000
@@ -5,8 +5,10 @@
#include "N5110.h"
#include "Gamepad.h"
#include "FXOS8700CQ.h"
+#include "Bitmap.h"
#include "SnakeBody.h"
#include "Food.h"
+#include "Map.h"
#include <vector>
class SnakeEngine
@@ -16,11 +18,33 @@
SnakeEngine();
~SnakeEngine();
- void init(FXOS8700CQ &mag);
- void move_body(Gamepad &pad, N5110 &lcd, bool &death);
- int score;
+ void welcome(N5110 &lcd);
+
+ void menu1_init(N5110 &lcd);
+ void menu1_select(N5110 &lcd, Gamepad &pad);
+
+ void menu2_init(N5110 &lcd);
+ void menu2_select(N5110 &lcd, Gamepad &pad);
+
+ void game_init(Gamepad &pad, N5110 &lcd, FXOS8700CQ &mag);
+ void game_run(Gamepad &pad, N5110 &lcd);
+
+ void death_init(N5110 &lcd);
+ void death_select(N5110 &lcd, Gamepad &pad);
+
+ //void init(FXOS8700CQ &mag);
+ void move_body(Gamepad &pad, N5110 &lcd);
+
void transition_black(N5110 &lcd);
void transition_white(N5110 &lcd);
+ void select_circles(N5110 &lcd, int line);
+ void preview(N5110 &lcd, int _map);
+ void draw_map2(N5110 &lcd);
+ void draw_map3(N5110 &lcd);
+ void draw_map4(N5110 &lcd);
+
+ int score;
+ int _game_state;
//void init(VARIABLES);
//void update(Gamepad &pad);
@@ -31,33 +55,17 @@
SnakeBody _body;
Food _food;
+ //bool _game = true;
void snake_food_collision(Gamepad &pad, int &_length);
-
- float _angle;
-
- /*
- void check_wall_collision(Gamepad &pad);
- void check_paddle_collisions(Gamepad &pad);
- void check_goal(Gamepad &pad);
- void print_scores(N5110 &lcd);
+ void map();
+ float _angle;
+ int _menu_select;
+ int _map;
- Paddle _p1;
- Paddle _p2;
-
- int _paddle_width;
- int _paddle_height;
- int _ball_size;
- int _speed;
+ //Bitmap snake_select1(snake_select1, 8, 8);
+ //Bitmap snake_select2(snake_select2, 16, 8);
+ //Bitmap snake_select3(snake_select3, 24, 8);
- // x positions of the paddles
- int _p1x;
- int _p2x;
-
- Ball _ball;
-
- Direction _d;
- float _mag;
- */
};
#endif
\ No newline at end of file