Steven Mahasin / Mbed 2 deprecated DreamDungeon

Dependencies:   mbed MotionSensor

Revision:
27:a1b41626f57c
Parent:
23:5a8f75e93508
Child:
28:98848e6a77a2
--- a/Entity/Snake/Snake.cpp	Mon Apr 29 02:45:17 2019 +0000
+++ b/Entity/Snake/Snake.cpp	Mon Apr 29 10:39:09 2019 +0000
@@ -46,7 +46,7 @@
 }
 
 // Functions
-void Snake::move(float player_x, float player_y)
+void Snake::move(float player_x, float player_y, int * map)
 {
     std::complex<double> pos_diff(player_x - position.x, player_y - position.y); // defining difference in position as a vector
     velocity = velocity_pattern[_velocity_index]; // Creating slithering effect, changing velocity of movement
@@ -84,8 +84,8 @@
         update_hitbox(7, 4, 12, 7, 0, 4, 4);
     }
 
-    undo_move_x(matrix_collision_test(position.x, prev_pos.y, 0));
-    undo_move_y(matrix_collision_test(prev_pos.x, position.y, 0));
+    undo_move_x(matrix_collision_test(position.x, prev_pos.y, map));
+    undo_move_y(matrix_collision_test(prev_pos.x, position.y, map));
 
     frame.count++;
     if (frame.count >= 10) {