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-24
- Revision:
- 7:dd84e0fab346
- Parent:
- 6:6c9453397f4a
- Child:
- 8:bcc3403d7e79
File content as of revision 7:dd84e0fab346:
#ifndef SNAKEENGINE_H
#define SNAKEENGINE_H
#include "mbed.h"
#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
{
public:
SnakeEngine();
~SnakeEngine();
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);
//void draw(N5110 &lcd);
private:
SnakeBody _body;
Food _food;
//bool _game = true;
void snake_food_collision(Gamepad &pad, int &_length);
void map();
float _angle;
int _menu_select;
int _map;
//Bitmap snake_select1(snake_select1, 8, 8);
//Bitmap snake_select2(snake_select2, 16, 8);
//Bitmap snake_select3(snake_select3, 24, 8);
};
#endif