ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18s2a_2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Apple.h Source File

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