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
SnakeEngine/SnakeEngine.h
- Committer:
- JoeShotton
- Date:
- 2020-05-23
- Revision:
- 4:ea3fa51c4386
- Parent:
- 3:fcd6d70e9694
- Child:
- 5:06fa7674622a
File content as of revision 4:ea3fa51c4386:
#ifndef SNAKEENGINE_H
#define SNAKEENGINE_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "FXOS8700CQ.h"
#include "SnakeBody.h"
#include "Food.h"
#include <vector>
class SnakeEngine
{
public:
SnakeEngine();
~SnakeEngine();
void init();
void move_body(Gamepad &pad, N5110 &lcd, bool &death);
int score;
//void init(VARIABLES);
//void update(Gamepad &pad);
//void draw(N5110 &lcd);
private:
SnakeBody _body;
Food _food;
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);
Paddle _p1;
Paddle _p2;
int _paddle_width;
int _paddle_height;
int _ball_size;
int _speed;
// x positions of the paddles
int _p1x;
int _p2x;
Ball _ball;
Direction _d;
float _mag;
*/
};
#endif