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: mbed
Diff: Alien/Alien.cpp
- Revision:
- 14:e88bcf5c0887
- Parent:
- 13:b85f14d35be1
- Child:
- 15:dde4ce4bf7fe
diff -r b85f14d35be1 -r e88bcf5c0887 Alien/Alien.cpp --- a/Alien/Alien.cpp Wed Apr 01 16:00:44 2020 +0000 +++ b/Alien/Alien.cpp Fri Apr 03 11:19:53 2020 +0000 @@ -22,7 +22,7 @@ return p; } -void Alien::update(N5110 &lcd, int step_x, int remainder_x) { +void Alien::update(int step_x, int remainder_x, Gamepad &pad) { X+=Speed; int _step_x = step_x; int _remainder_x = remainder_x; @@ -36,15 +36,9 @@ Speed = -Speed; Y = Y + 2; } - collision(lcd); -} - -void Alien::collision(N5110 &lcd) { - for(int i = X; i < X + Size; i++) { - if(lcd.getPixel(i,Y + Size + 1)) { - Alive = false; - } - } } +void Alien::set_life(bool x){ + Alive = x; + }