ELEC2645 (2018/19) / Mbed 2 deprecated el17dg

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers gameobject.h Source File

gameobject.h

00001 #ifndef GAMEOBJECT_H
00002 #define GAMEOBJECT_H
00003 
00004 #include "collision_lib.h"
00005 
00006 /////////////////////////////////////////////////////////////////////
00007 /** 
00008  * GameObject Class
00009  * @brief Base class for all objects in the game world.
00010  * @author Dmitrijs Griskovs
00011  * @date 15/04/2019
00012  */
00013 class GameObject {
00014 public:
00015 /** 
00016  * @brief Activates the object at the given postion.
00017  * @param spawn_pos sets position of x and y into pos (Point).
00018  */
00019     void spawn(Point spawn_pos) {
00020         pos = spawn_pos;
00021         active = true;
00022     }
00023     Point pos;
00024     bool active;
00025 };
00026 
00027 #endif