I am learning OOP using c++ on a MicroBit by developing this simple game
gameEngine/source/Spacecraft.cpp
- Committer:
- ahmeou
- Date:
- 2020-07-09
- Revision:
- 3:a21366e3261e
- Parent:
- 0:17bdfb0e7069
File content as of revision 3:a21366e3261e:
#include "Spacecraft.h" Spacecraft::Spacecraft(){ setX(2); setY(4); } void Spacecraft::moveLeft(){ int x = getX() - 1; if(x < 0) x = 4; setX(x); } void Spacecraft::moveRight(){ m_x = (m_x + 1) % 5; } bool Spacecraft::isBlinking(){ return blinking; } void Spacecraft::blink(){ blinking = true; }