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 Gamepad N5110 mbed-rtos
Diff: GameEngine/GameEngine.cpp
- Revision:
- 3:bf9624e5b0c3
- Parent:
- 2:b5c1bb7a39de
- Child:
- 4:4d673fb2d9dc
--- a/GameEngine/GameEngine.cpp Sat Apr 20 00:08:00 2019 +0000 +++ b/GameEngine/GameEngine.cpp Thu Apr 25 16:31:27 2019 +0000 @@ -166,7 +166,7 @@ _d = pad.get_direction(); // Get the direction of the joystick _mag = pad.get_mag(); // Get the magnitude value _R = pad.check_event(Gamepad::R_PRESSED); // Check if the R button is being pressed - _L = pad.check_event(Gamepad::R_PRESSED); // Check if the L button is being pressed + _L = pad.check_event(Gamepad::L_PRESSED); // Check if the L button is being pressed } @@ -895,9 +895,13 @@ // get health of the enemy int e1_health = _e1.get_health(); + if (e21_health < 10){ lcd.drawRect(62,42,20,4,FILL_TRANSPARENT); lcd.drawRect(62,42,20-2*e1_health,4,FILL_BLACK); - + } + else { + lcd.drawRect(62,42,20,4,FILL_TRANSPARENT); + } }