ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18s2a_2

Dependencies:   mbed

Committer:
Psy1990
Date:
Fri Jun 05 18:45:05 2020 +0000
Revision:
10:3e37b58e8600
Parent:
8:32825d724856
Child:
11:ba20e1b516a1
Got movement of the snake working! Cleaned up the code of unused stuff and added comments to describe what each thing does.

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 8:32825d724856 7
Psy1990 8:32825d724856 8
Psy1990 8:32825d724856 9
Psy1990 8:32825d724856 10 class Apple
Psy1990 8:32825d724856 11
Psy1990 8:32825d724856 12 {
Psy1990 8:32825d724856 13 public:
Psy1990 8:32825d724856 14
Psy1990 8:32825d724856 15 Apple();
Psy1990 8:32825d724856 16 ~Apple();
Psy1990 10:3e37b58e8600 17 void init(int size); // Inital setup
Psy1990 10:3e37b58e8600 18 void draw(N5110 &lcd); // Draws the Apple on the LCD
Psy1990 10:3e37b58e8600 19 Vector2D get_pos(); // Needed for Poistioning
Psy1990 10:3e37b58e8600 20 void set_pos(Vector2D a); // Needed for Poistioning
Psy1990 8:32825d724856 21
Psy1990 8:32825d724856 22 private:
Psy1990 8:32825d724856 23
Psy1990 10:3e37b58e8600 24 int _x; // X Value of Apple
Psy1990 10:3e37b58e8600 25 int _y; // Y Value of Apple
Psy1990 10:3e37b58e8600 26 int _size; //Size set in main.cpp
Psy1990 8:32825d724856 27
Psy1990 8:32825d724856 28 };
Psy1990 8:32825d724856 29 #endif