ELEC2645 (2018/19) / Mbed 2 deprecated ll16o2l_ELEC2645

Dependencies:   mbed Gamepad

Committer:
ll16o2l
Date:
Thu Apr 25 15:08:52 2019 +0000
Revision:
3:aa82968b7a8e
Parent:
2:888634fff8ff
Child:
4:b71e0eed67db
Completed Dodge game

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ll16o2l 2:888634fff8ff 1 #ifndef Objects_H
ll16o2l 2:888634fff8ff 2 #define Objects_H
ll16o2l 2:888634fff8ff 3
ll16o2l 2:888634fff8ff 4 #include "mbed.h"
ll16o2l 2:888634fff8ff 5 #include "N5110.h"
ll16o2l 2:888634fff8ff 6 #include "Gamepad.h"
ll16o2l 2:888634fff8ff 7 #include "Player.h"
ll16o2l 2:888634fff8ff 8
ll16o2l 3:aa82968b7a8e 9 /**
ll16o2l 3:aa82968b7a8e 10 * @file Objects Class
ll16o2l 3:aa82968b7a8e 11 * @author Oliver Luong, University of Leeds
ll16o2l 3:aa82968b7a8e 12 * @brief Controls the objects in the Dodge game
ll16o2l 3:aa82968b7a8e 13 * @date 22/04/2019
ll16o2l 2:888634fff8ff 14 */
ll16o2l 2:888634fff8ff 15 class Objects
ll16o2l 2:888634fff8ff 16 {
ll16o2l 2:888634fff8ff 17
ll16o2l 2:888634fff8ff 18 public:
ll16o2l 2:888634fff8ff 19 Objects();
ll16o2l 2:888634fff8ff 20 ~Objects();
ll16o2l 2:888634fff8ff 21 void init(int size,int speed);
ll16o2l 2:888634fff8ff 22 void draw(N5110 &lcd);
ll16o2l 2:888634fff8ff 23 void update();
ll16o2l 2:888634fff8ff 24 /// accessors and mutators
ll16o2l 2:888634fff8ff 25 void set_velocity(Vector2D v);
ll16o2l 2:888634fff8ff 26 Vector2D get_velocity();
ll16o2l 2:888634fff8ff 27 Vector2D get_pos();
ll16o2l 2:888634fff8ff 28 void set_pos(Vector2D p);
ll16o2l 2:888634fff8ff 29
ll16o2l 2:888634fff8ff 30 private:
ll16o2l 2:888634fff8ff 31
ll16o2l 2:888634fff8ff 32 Vector2D _velocity;
ll16o2l 2:888634fff8ff 33 int _size;
ll16o2l 2:888634fff8ff 34 int _x;
ll16o2l 2:888634fff8ff 35 int _y;
ll16o2l 2:888634fff8ff 36 int _x_edge;
ll16o2l 2:888634fff8ff 37 int _y_edge;
ll16o2l 2:888634fff8ff 38 };
ll16o2l 2:888634fff8ff 39 #endif