ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18s2a_2

Dependencies:   mbed

Committer:
Psy1990
Date:
Fri Jun 05 22:35:50 2020 +0000
Revision:
15:15577b650c2e
Parent:
11:ba20e1b516a1
Child:
16:8cb23849b95a
Updating Docs

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Psy1990 8:32825d724856 1 #ifndef APPLE_H
Psy1990 8:32825d724856 2 #define APPLE_H
Psy1990 8:32825d724856 3
Psy1990 8:32825d724856 4 #include "mbed.h"
Psy1990 8:32825d724856 5 #include "N5110.h"
Psy1990 8:32825d724856 6 #include "Gamepad.h"
Psy1990 11:ba20e1b516a1 7 /** Apple Class File
Psy1990 11:ba20e1b516a1 8 * @brief Class containing the apple that the snake uses to get score and increase in size.
Psy1990 11:ba20e1b516a1 9 * @author Simon Atkinson
Psy1990 11:ba20e1b516a1 10 * @date June 2020
Psy1990 11:ba20e1b516a1 11 */
Psy1990 8:32825d724856 12
Psy1990 8:32825d724856 13
Psy1990 8:32825d724856 14 class Apple
Psy1990 8:32825d724856 15
Psy1990 8:32825d724856 16 {
Psy1990 8:32825d724856 17 public:
Psy1990 8:32825d724856 18
Psy1990 8:32825d724856 19 Apple();
Psy1990 8:32825d724856 20 ~Apple();
Psy1990 15:15577b650c2e 21 /**
Psy1990 15:15577b650c2e 22 @pram The Initial setup of the of the apple
Psy1990 15:15577b650c2e 23 */
Psy1990 15:15577b650c2e 24 void init(int size);
Psy1990 15:15577b650c2e 25 /**
Psy1990 15:15577b650c2e 26 @pram Draws the Apple on the LCD
Psy1990 15:15577b650c2e 27 */
Psy1990 15:15577b650c2e 28 void draw(N5110 &lcd);
Psy1990 15:15577b650c2e 29 /**
Psy1990 15:15577b650c2e 30 @returns Gives us position data
Psy1990 15:15577b650c2e 31 */
Psy1990 15:15577b650c2e 32 Vector2D get_pos();
Psy1990 15:15577b650c2e 33 /**
Psy1990 15:15577b650c2e 34 @pram Sets the Position
Psy1990 15:15577b650c2e 35 */
Psy1990 15:15577b650c2e 36 void set_pos(Vector2D a); //
Psy1990 8:32825d724856 37
Psy1990 8:32825d724856 38 private:
Psy1990 8:32825d724856 39
Psy1990 10:3e37b58e8600 40 int _x; // X Value of Apple
Psy1990 10:3e37b58e8600 41 int _y; // Y Value of Apple
Psy1990 10:3e37b58e8600 42 int _size; //Size set in main.cpp
Psy1990 8:32825d724856 43
Psy1990 8:32825d724856 44 };
Psy1990 8:32825d724856 45 #endif