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.
element.h
00001 #ifndef ELEMENT_H 00002 #define ELEMENT_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 /** snakegame 00008 * @brief snakegame 00009 * @author WUWEILONG 201282622 00010 * @date May.2019 00011 */ 00012 class element 00013 { 00014 00015 public: 00016 /** Constructor */ 00017 element(); 00018 /** Destructor */ 00019 ~element(); 00020 void init(int foodsize,int foodx,int foody,int snakex,int snakey,int n); 00021 Vector2D getfoodpos(); 00022 Vector2D getsnakepos(int n); 00023 void draw(N5110 &lcd,int n); 00024 void update(); 00025 void input(Gamepad &pad); 00026 void move(int n); 00027 void initdirection(); 00028 00029 00030 00031 00032 /// accessors and mutators 00033 00034 private: 00035 00036 int _size; 00037 Vector2D _foodpos; 00038 Vector2D _snakebody[]; 00039 Direction _d; 00040 00041 }; 00042 #endif
Generated on Mon Jul 18 2022 21:33:22 by
1.7.2