Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: Snake/Snake.cpp
- Revision:
- 39:210ac915e0a0
- Parent:
- 37:ee47699915b8
- Child:
- 41:4edac50f010d
--- a/Snake/Snake.cpp Mon Apr 22 04:24:38 2019 +0000 +++ b/Snake/Snake.cpp Mon Apr 22 05:28:37 2019 +0000 @@ -263,73 +263,6 @@ return snakepos_b9; //printf("snakepos_b9 from player = %f %f \n", snakepos_b9.x, snakepos_b9.y); } -/* -Vector2D Snake::get_pos_before10(int length) //this sends data of following sprites. -{ - for(int i=11; i<=15; i++) { - if(length == i) { - Vector2D snakepos_b10 = {_x[i-11],_y[i-11]}; //Obtains the snake position. - return snakepos_b10; - } - } - Vector2D snakepos_b10 = {-20,-20}; //Obtains the snake position. - return snakepos_b10; - //printf("snakepos_b10 from player = %f %f \n", snakepos_b10.x, snakepos_b10.y); -} - -Vector2D Snake::get_pos_before11(int length) //this sends data of following sprites. -{ - for(int i=12; i<=15; i++) { - if(length == i) { - Vector2D snakepos_b11 = {_x[i-12],_y[i-12]}; //Obtains the snake position. - return snakepos_b11; - } - } - Vector2D snakepos_b11 = {-20,-20}; //Obtains the snake position. - return snakepos_b11; - //printf("snakepos_b11 from player = %f %f \n", snakepos_b11.x, snakepos_b11.y); -} - -Vector2D Snake::get_pos_before12(int length) //this sends data of following sprites. -{ - for(int i=13; i<=15; i++) { - if(length == i) { - Vector2D snakepos_b12 = {_x[i-13],_y[i-13]}; //Obtains the snake position. - return snakepos_b12; - } - } - Vector2D snakepos_b12 = {-20,-20}; //Obtains the snake position. - return snakepos_b12; - //printf("snakepos_b12 from player = %f %f \n", snakepos_b12.x, snakepos_b12.y); -} - -Vector2D Snake::get_pos_before13(int length) //this sends data of following sprites. -{ - for(int i=14; i<=15; i++) { - if(length == i) { - Vector2D snakepos_b13 = {_x[i-14],_y[i-14]}; //Obtains the snake position. - return snakepos_b13; - } - } - Vector2D snakepos_b13 = {-20,-20}; //Obtains the snake position. - return snakepos_b13; - //printf("snakepos_b13 from player = %f %f \n", snakepos_b13.x, snakepos_b13.y); -} - -Vector2D Snake::get_pos_before14(int length) //this sends data of following sprites. -{ - for(int i=15; i<=15; i++) { - if(length == i) { - Vector2D snakepos_b14 = {_x[i-15],_y[i-15]}; //Obtains the snake position. - return snakepos_b14; - } - } - Vector2D snakepos_b14 = {-20,-20}; //Obtains the snake position. - return snakepos_b14; - //printf("snakepos_b14 from player = %f %f \n", snakepos_b14.x, snakepos_b14.y); -} -*/ - void Snake::update(Direction d,int length, int speed, int* b) {