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: Enemy/EnemyBoss.cpp
- Revision:
- 7:574c66ebd8b0
- Parent:
- 6:1fcfd331c047
--- a/Enemy/EnemyBoss.cpp Wed May 08 10:03:24 2019 +0000
+++ b/Enemy/EnemyBoss.cpp Thu May 09 09:54:50 2019 +0000
@@ -66,28 +66,28 @@
int direction = rand() % 8; // randomise initial direction.
// 8 possibilities. Get random modulo and set movement accordingly
- if (direction == 0) {
+ if (direction == 0) { // North
_movement.x = 0;
- _movement.y = -_speed;
- } else if (direction == 1) {
+ _movement.y = -_speed;
+ } else if (direction == 1) { // North-East
_movement.x = _speed;
_movement.y = -_speed;
- } else if (direction == 2) {
+ } else if (direction == 2) { // East
_movement.x = _speed;
_movement.y = 0;
- } else if (direction == 3) {
+ } else if (direction == 3) { // South-East
_movement.x = _speed;
_movement.y = _speed;
- } else if (direction == 4) {
+ } else if (direction == 4) { // South
_movement.x = 0;
_movement.y = _speed;
- } else if (direction == 5) {
+ } else if (direction == 5) { // South-West
_movement.x = -_speed;
_movement.y = _speed;
- } else if (direction == 6) {
+ } else if (direction == 6) { // West
_movement.x = -_speed;
_movement.y = 0;
- }else {
+ }else { // North-West
_movement.x = -_speed;
_movement.y = -_speed;
}