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 MotionSensor
Diff: Entity/Player/Player.cpp
- Revision:
- 11:63e54f6e7939
- Parent:
- 10:1a3499f6b583
- Child:
- 12:a1c1991835ca
--- a/Entity/Player/Player.cpp Sun Apr 21 23:23:35 2019 +0000
+++ b/Entity/Player/Player.cpp Tue Apr 23 03:10:09 2019 +0000
@@ -16,11 +16,11 @@
}
void Player::move(float mapped_x, float mapped_y){
- if(!matrix_collision_test(position.x + 1.2f*mapped_x, position.y, 0)){
- position.x += 1.2f*mapped_x;
+ if(!matrix_collision_test(position.x + player_speed*mapped_x, position.y, 0)){
+ position.x += player_speed*mapped_x;
}
- if(!matrix_collision_test(position.x, position.y - 1.2f*mapped_y, 0)){
- position.y -= 1.2f*mapped_y;
+ if(!matrix_collision_test(position.x, position.y - player_speed*mapped_y, 0)){
+ position.y -= player_speed*mapped_y;
}
moving = false;
if (abs(mapped_x) + abs(mapped_y) > 0.1f){