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.
Dependencies: 4DGL-uLCD-SE PinDetect mbed
SpaceShipEarth.cpp
00001 #include "SpaceShipEarth.h" 00002 00003 int spaceship_earth1[EARTH_WIDTH *EARTH_HEIGHT] = { 00004 _,_,S,S,S,S,S,S,_,_, 00005 _,S,I,I,I,I,I,I,S,_, 00006 S,I,I,I,I,I,I,I,I,S, 00007 S,I,I,I,I,I,I,I,I,S, 00008 S,I,I,I,I,I,I,I,I,S, 00009 S,I,I,I,I,I,I,I,I,S, 00010 S,I,I,I,I,I,I,I,I,S, 00011 S,I,I,I,I,I,I,I,I,S, 00012 S,I,I,I,I,I,I,I,S,_, 00013 _,S,S,S,S,S,S,S,_,_, 00014 }; 00015 00016 int earthErase[EARTH_WIDTH * EARTH_HEIGHT] = { 00017 _,_,_,_,_,_,_,_,_,_, 00018 _,_,_,_,_,_,_,_,_,_, 00019 _,_,_,_,_,_,_,_,_,_, 00020 _,_,_,_,_,_,_,_,_,_, 00021 _,_,_,_,_,_,_,_,_,_, 00022 _,_,_,_,_,_,_,_,_,_, 00023 _,_,_,_,_,_,_,_,_,_, 00024 _,_,_,_,_,_,_,_,_,_, 00025 _,_,_,_,_,_,_,_,_,_, 00026 _,_,_,_,_,_,_,_,_,_, 00027 }; 00028 00029 SpaceShipEarth::SpaceShipEarth() { 00030 setX(63); 00031 setY(63); 00032 setSprite(spaceship_earth1); 00033 setDestroyed(false); 00034 setHeight(EARTH_HEIGHT); 00035 setWidth(EARTH_WIDTH); 00036 } 00037 00038 void SpaceShipEarth::draw() { 00039 uLCD.BLIT(getX() - (EARTH_WIDTH / 2), getY() - (EARTH_HEIGHT / 2), 00040 EARTH_WIDTH, EARTH_HEIGHT, getSprite()); 00041 } 00042 00043 void SpaceShipEarth::update() { 00044 uLCD.BLIT(getX() - (EARTH_WIDTH / 2), getY() - (EARTH_HEIGHT / 2), 00045 EARTH_WIDTH, EARTH_HEIGHT, earthErase); 00046 }
Generated on Fri Jul 15 2022 18:55:10 by
1.7.2