Laila Al Badwawi 200906179 SpaceInvaders I declare this my own independent work and understand the university rules on plagiarism.
Dependencies: mbed
Diff: Spaceship/Spaceship.cpp
- Revision:
- 109:2137a6a63840
- Parent:
- 108:ca888bb3ed54
- Child:
- 110:755a3a75d9b0
--- a/Spaceship/Spaceship.cpp Sun May 05 13:29:31 2019 +0000 +++ b/Spaceship/Spaceship.cpp Sun May 05 13:31:19 2019 +0000 @@ -29,6 +29,18 @@ { _speed_spaceship = int(mag*10.0f); + if(d==N) + //pong.update(pad); + //render(); + _y_spaceship-=2; + else + if(d==S) + _y_spaceship+=2; + if(_y_spaceship>=30) + _y_spaceship=30; + else + if(_y_spaceship<=0) + _y_spaceship=0; }