Commit 6949db4d authored by Nelson Phillips's avatar Nelson Phillips

autosave

parent 3a943d72
......@@ -55,7 +55,8 @@ vector <Body> parts;
bool Snake::draw(){
for (int i = 0; i < 29; i++){
for (int i = 0; i < 29; i++){
for (int q = 0; q < 60; q++){
if (x < 1)return false;
if (y < 1)return false;
......@@ -65,12 +66,13 @@ vector <Body> parts;
if (h == i || o == q)
grid[h][o] = '*';
if (i == 27 || i == 0)
grid[i][q] = '|';
grid[i][q] = '-';
if(q == 0 || q == 59)
grid[i][q] = '_';
grid[i][q] = '|';
for ( int count = 0; count < parts.size(); count++){
for ( int count = 0; count < parts.size(); count++){
if (grid[parts[0].getX()][parts[0].getY()] == '-') return false;
if (count == 0){
if( direction == 2)
......@@ -89,14 +91,10 @@ vector <Body> parts;
}
else
grid[parts[count].getX()][parts[count].getY()] = '-';
}
}
}
}
for (int i = 0; i < 29; i++){
cout << endl;
for (int q = 0; q < 60; q++){
......@@ -113,7 +111,7 @@ if (grid [x][y] == grid[h][o] ){
bdy.newBody();
bonusBody--;
}
return true;
return hi;
}
int Snake::snekoScore(){
return score;
......@@ -148,10 +146,7 @@ return true;
" |_____||__,_|_| |_| |_||___| |____/ |_/ |___|_|" << endl;
}
void Body::changeX(bool updown){
......
......@@ -17,6 +17,7 @@ class Snake {
int getY();
void newBody();
void GameOver();
bool fillspace();
private:
......
g++ *.cpp -o main.out -pthread -std=c++11 && ./main.outf
\ No newline at end of file
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