
Final Commit
Dependencies: mbed
Diff: Food/Food.cpp
- Revision:
- 17:94dd8a691d4a
- Parent:
- 15:4c97fe30f3b7
- Child:
- 18:406fc298a7c4
--- a/Food/Food.cpp Wed Apr 18 10:38:10 2018 +0000 +++ b/Food/Food.cpp Wed Apr 25 10:21:54 2018 +0000 @@ -59,12 +59,21 @@ } -void Food::set_food_position(int set_frames, int number_frames) +void Food::set_food_position(int set_frames, int number_frames, bool collision) { Vector2D pos = get_rand_pos(); + + if(collision) { - if(set_frames == number_frames) { + _x = pos.x; + _y = pos.y; + + g_fc = 0; + + } + + else if(set_frames == number_frames) { _x = pos.x; _y = pos.y;