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
Revision 6:104c2506237e, committed 2019-04-16
- Comitter:
- el17sm
- Date:
- Tue Apr 16 12:30:33 2019 +0000
- Parent:
- 5:75b6cb06372a
- Child:
- 7:4aaa37a711a1
- Commit message:
- Start of Entity Class;
Changed in this revision
--- a/main.cpp Mon Apr 15 03:05:40 2019 +0000
+++ b/main.cpp Tue Apr 16 12:30:33 2019 +0000
@@ -22,9 +22,9 @@
lcd.clear();
lcd.drawSprite(0,0,48,84,(int *)level_map[1]);
- lcd.drawSpriteTransparent(player_pos[0],player_pos[1]-7,12,6,(int *)player[face][(int)(moving*(counter/10)%4)]);
+ lcd.drawSpriteTransparent(player_pos[0],player_pos[1]-7,12,6,(int *)player[face][(int)(moving*(counter/5)%4)]);
lcd.refresh();
- wait_ms(1000/60);
+ wait_ms(1000/20);
counter++;
}
--- a/main.h Mon Apr 15 03:05:40 2019 +0000
+++ b/main.h Tue Apr 16 12:30:33 2019 +0000
@@ -30,8 +30,8 @@
void move_player() {
Vector2D mapped_coord = gamepad.get_mapped_coord();
- future_player_pos[0] = player_pos[0] + mapped_coord.x/2;
- future_player_pos[1] = player_pos[1] - mapped_coord.y/2;
+ future_player_pos[0] = player_pos[0] + mapped_coord.x;
+ future_player_pos[1] = player_pos[1] - mapped_coord.y;
if(matrix_collision_test(future_player_pos[0], player_pos[1], 0, 6, 5)){
player_pos[0] = future_player_pos[0];
}