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
Apple.h
00001 #ifndef APPLE_H 00002 #define APPLE_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 /** Apple Class File 00008 * @brief Class containing the apple that the snake uses to get score and increase in size. 00009 * @author Simon Atkinson 00010 * @date June 2020 00011 */ 00012 00013 00014 class Apple 00015 00016 { 00017 public: 00018 00019 Apple(); 00020 ~Apple(); 00021 /** 00022 @pram The Initial setup of the of the apple 00023 */ 00024 void init(int size); 00025 /** 00026 @pram Draws the Apple on the LCD 00027 */ 00028 void draw(N5110 &lcd); 00029 /** 00030 @return Gives us position data 00031 */ 00032 Vector2D get_pos (); 00033 /** 00034 @pram Sets the Position 00035 */ 00036 void set_pos(Vector2D a); // 00037 00038 private: 00039 00040 int _x; // X Value of Apple 00041 int _y; // Y Value of Apple 00042 int _size; //Size set in main.cpp 00043 00044 }; 00045 #endif
Generated on Sat Jul 16 2022 21:38:04 by
1.7.2