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: Enemy/Enemy.cpp
- Revision:
- 31:5c4acae51026
- Parent:
- 30:863565e9859f
- Child:
- 33:de130e274391
--- a/Enemy/Enemy.cpp Thu May 09 08:59:39 2019 +0000 +++ b/Enemy/Enemy.cpp Thu May 09 10:15:20 2019 +0000 @@ -7,8 +7,8 @@ } void Enemy::update(Vector2D floor_pos) // sets its position { - _position.x = floor_pos.x + 7 - 6; // the + 7 for the centre of the floor and the + 6 for the centre of the ghost - _position.y = floor_pos.y - 2 - 13; // the - 2 is so that it is on top of the floor's position + _position.x = floor_pos.x + 7 - 6; // the + 7 for the centre of the floor and the + 6 for the centre of the ghost + _position.y = floor_pos.y - 1 - 13; // the - 1 is so that it is on top of the floor's position // and the + 15 is so that it considers the position of the feet of the ghost (not the top) } @@ -33,7 +33,7 @@ void Enemy::erase() // decides if it gets erased { - _position.x = 90; // the ghost's is no longer shown on the screen + _position.x = 90; // the ghost's is no longer shown on the screen _position.y = 50; }