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.
main.cpp
- Committer:
- ahmeou
- Date:
- 2020-07-08
- Revision:
- 0:17bdfb0e7069
- Child:
- 1:25f13b341b11
File content as of revision 0:17bdfb0e7069:
#include "MicroBit.h" #include "game.h" #include "Screen.h" MicroBit ubit; int main(){ Screen screen(&ubit); Spacecraft spacecraft; Bullet bullet; bullet.setX(spacecraft.getX()); bullet.setY(spacecraft.getY()); // while(true){ // screen.draw(bullet); // screen.draw(spacecraft); // screen.refresh(); // // // move spacecraft // spacecraft.setX(spacecraft.getX() + 1 - 2 * ubit.random(1)); // // // move bullet // for(int i = 0; i < 2; i++){ // if(bullet.getY() == 0) // bullet.setX(spacecraft.getX()); // bullet.move(); // ubit.sleep(200); // } // // } release_fiber(); }