Snake

Dependencies:   mbed

Fork of el17x2l by LI Xiang

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Menu.h Source File

Menu.h

00001 #ifndef MENU_H
00002 #define MENU_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 
00008 #include "Food.h"
00009 #include "Snake.h"
00010 
00011 class Menu
00012 {
00013     
00014 public:
00015     Menu();
00016     ~Menu();
00017 
00018     void init(Gamepad &pad,N5110 &lcd);
00019     void render(Gamepad &pad,N5110 &lcd);
00020     void eatfood(Gamepad &pad,N5110 &lcd);
00021     void printscore(N5110 &lcd);
00022     void game(Gamepad &pad,N5110 &lcd);
00023     void gameover(N5110 &lcd);
00024     void pause(Gamepad &pad,N5110 &lcd);
00025 
00026     void add_score();
00027     int get_score();
00028 
00029 private:
00030     void changespeed1(Gamepad &pad,N5110 &lcd);
00031     void changespeed2(Gamepad &pad,N5110 &lcd);
00032     void changespeed3(Gamepad &pad,N5110 &lcd);
00033 
00034     int sv;
00035     int speed;
00036     int _score;
00037     Direction d;
00038     Food _food;
00039     Snake _snake;
00040 };
00041 
00042 #endif