Commit ea79e367 authored by Nelson Phillips's avatar Nelson Phillips

autosave

parent 0c34d90e
......@@ -60,7 +60,6 @@ void Snake::movement(char input){
for (int i = 0; i < 29; i++){
for (int q = 0; q < 60; q++){
if (x < 1)return false; // end the loop if it hits a wall
if (y < 1)return false;
if (x > 26)return false;
......@@ -80,7 +79,7 @@ void Snake::movement(char input){
if (grid[parts[0].getX()][parts[0].getY()] == '-') return false; // if a body connects with another you lose
if (count == 0){// display for head
if (count == 0){// display for head in specific directions
if( direction == 2)
grid[parts[count].getX()][parts[count].getY()] = '>';
......@@ -119,11 +118,14 @@ if (grid [x][y] == grid[h][o] ){ // randomizes the apples
score++;
newBody();
bonusBody = bonusBody + 5;
}else if (bonusBody > 0){ // adds body parts every loop after picking up apples
while(grid[h][o] == '-'){
h = (rand() % 26) + 1;
o = (rand() % 57) + 1;
}
}else if (bonusBody > 0){ // adds body parts every loop after picking up apples
newBody();
bonusBody--;
}
}
return hi;
}
......
......@@ -24,7 +24,6 @@ class Body {
int x, y;
int lastX, lastY;
char piece;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment