Joe Shotton / Mbed 2 deprecated ELEC2645_Project_ll16j23s

Dependencies:   mbed ll16j23s_test_docs

Committer:
JoeShotton
Date:
Sat May 23 20:01:00 2020 +0000
Revision:
6:6c9453397f4a
Parent:
5:06fa7674622a
Child:
7:dd84e0fab346
Implemented screen transition function

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 3:fcd6d70e9694 8 #include "SnakeBody.h"
JoeShotton 3:fcd6d70e9694 9 #include "Food.h"
JoeShotton 3:fcd6d70e9694 10 #include <vector>
JoeShotton 3:fcd6d70e9694 11
JoeShotton 3:fcd6d70e9694 12 class SnakeEngine
JoeShotton 3:fcd6d70e9694 13 {
JoeShotton 3:fcd6d70e9694 14
JoeShotton 3:fcd6d70e9694 15 public:
JoeShotton 3:fcd6d70e9694 16 SnakeEngine();
JoeShotton 3:fcd6d70e9694 17 ~SnakeEngine();
JoeShotton 4:ea3fa51c4386 18
JoeShotton 5:06fa7674622a 19 void init(FXOS8700CQ &mag);
JoeShotton 4:ea3fa51c4386 20 void move_body(Gamepad &pad, N5110 &lcd, bool &death);
JoeShotton 4:ea3fa51c4386 21 int score;
JoeShotton 6:6c9453397f4a 22 void transition_black(N5110 &lcd);
JoeShotton 6:6c9453397f4a 23 void transition_white(N5110 &lcd);
JoeShotton 3:fcd6d70e9694 24
JoeShotton 3:fcd6d70e9694 25 //void init(VARIABLES);
JoeShotton 3:fcd6d70e9694 26 //void update(Gamepad &pad);
JoeShotton 3:fcd6d70e9694 27 //void draw(N5110 &lcd);
JoeShotton 3:fcd6d70e9694 28
JoeShotton 3:fcd6d70e9694 29 private:
JoeShotton 3:fcd6d70e9694 30
JoeShotton 4:ea3fa51c4386 31 SnakeBody _body;
JoeShotton 4:ea3fa51c4386 32 Food _food;
JoeShotton 4:ea3fa51c4386 33
JoeShotton 4:ea3fa51c4386 34 void snake_food_collision(Gamepad &pad, int &_length);
JoeShotton 4:ea3fa51c4386 35
JoeShotton 4:ea3fa51c4386 36 float _angle;
JoeShotton 4:ea3fa51c4386 37
JoeShotton 3:fcd6d70e9694 38 /*
JoeShotton 3:fcd6d70e9694 39 void check_wall_collision(Gamepad &pad);
JoeShotton 3:fcd6d70e9694 40 void check_paddle_collisions(Gamepad &pad);
JoeShotton 3:fcd6d70e9694 41 void check_goal(Gamepad &pad);
JoeShotton 3:fcd6d70e9694 42 void print_scores(N5110 &lcd);
JoeShotton 3:fcd6d70e9694 43
JoeShotton 3:fcd6d70e9694 44 Paddle _p1;
JoeShotton 3:fcd6d70e9694 45 Paddle _p2;
JoeShotton 3:fcd6d70e9694 46
JoeShotton 3:fcd6d70e9694 47 int _paddle_width;
JoeShotton 3:fcd6d70e9694 48 int _paddle_height;
JoeShotton 3:fcd6d70e9694 49 int _ball_size;
JoeShotton 3:fcd6d70e9694 50 int _speed;
JoeShotton 3:fcd6d70e9694 51
JoeShotton 3:fcd6d70e9694 52 // x positions of the paddles
JoeShotton 3:fcd6d70e9694 53 int _p1x;
JoeShotton 3:fcd6d70e9694 54 int _p2x;
JoeShotton 3:fcd6d70e9694 55
JoeShotton 3:fcd6d70e9694 56 Ball _ball;
JoeShotton 3:fcd6d70e9694 57
JoeShotton 3:fcd6d70e9694 58 Direction _d;
JoeShotton 3:fcd6d70e9694 59 float _mag;
JoeShotton 3:fcd6d70e9694 60 */
JoeShotton 3:fcd6d70e9694 61 };
JoeShotton 3:fcd6d70e9694 62
JoeShotton 3:fcd6d70e9694 63 #endif