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.
Spacecraft.cpp
00001 #include "Spacecraft.h" 00002 00003 Spacecraft::Spacecraft(){ 00004 setX(2); 00005 setY(4); 00006 } 00007 void Spacecraft::moveLeft(){ 00008 int x = getX() - 1; 00009 if(x < 0) x = 4; 00010 setX(x); 00011 } 00012 void Spacecraft::moveRight(){ 00013 m_x = (m_x + 1) % 5; 00014 } 00015 bool Spacecraft::isBlinking(){ 00016 return blinking; 00017 } 00018 void Spacecraft::blink(){ 00019 blinking = true; 00020 }
Generated on Sun Aug 7 2022 05:10:42 by
1.7.2