Steven Mahasin / Mbed 2 deprecated DreamDungeon

Dependencies:   mbed MotionSensor

Files at this revision

API Documentation at this revision

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

Entity.cpp Show annotated file Show diff for this revision Revisions of this file
Entity.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
--- 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];
     }