Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
GameObject.cpp
00001 #include "GameObject.h" 00002 00003 StaticGameObject::StaticGameObject() 00004 { 00005 } 00006 00007 StaticGameObject::~StaticGameObject() 00008 { 00009 } 00010 00011 const Vector2D& StaticGameObject::getPos() const 00012 { 00013 return pos; // Returns the x and y position of an object 00014 } 00015 00016 void StaticGameObject::move() 00017 { 00018 } 00019 00020 void StaticGameObject::draw(N5110 &lcd) 00021 { 00022 lcd.drawRect(pos.x,pos.y,w,h,FILL_BLACK); // Draws each object using the LCD class 00023 } 00024 00025 void GameObject::move() 00026 { 00027 pos.x += velocity.x; // Adds the velocity to the current x-position 00028 pos.y += velocity.y; // Adds the velocity to the current y-position 00029 }
Generated on Thu Jul 14 2022 02:02:53 by
1.7.2