Skip to content

Commit

Permalink
Movement Stable version No Animation
Browse files Browse the repository at this point in the history
  • Loading branch information
tpaslou committed Jan 11, 2018
1 parent 0efc9fe commit 7a9c002
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 9 additions & 5 deletions SourceCode/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ void Game::handleEvents() {
//Here we lose
cout << "END OF GAME " << endl;
}
else if (qbert->GetCurrCol() == 1) {
qbert->moveUpLeft();
else{
qbert->moveUpRight();
cout << "Position changed to : ";
qbert->PrintPos();
}
Expand Down Expand Up @@ -101,11 +101,15 @@ void Game::handleEvents() {
else if (event.key.keysym.sym == SDLK_LEFT) {
cout << "Left arrow pressed" << endl;
if (qbert->GetCurrCol() == 1) {
//we lose
cout << "END OF GAME" << endl;

//we lose
cout << "END OF GAME" << endl;
//or we take disk


}
else {
qbert->moveDownLeft();
qbert->moveUpLeft();
cout << "Position changed to : ";
qbert->PrintPos();

Expand Down
10 changes: 6 additions & 4 deletions SourceCode/Qbert.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,22 @@ class Qbert {
void moveDownRight() {
currRow++;
currCol++;
sprite->Move(50, 75);
}
void moveDownLeft() {
currRow++;
sprite->SetX(&sprite->GetX - 30);
sprite->SetY(&sprite->GetY + 30);
sprite->Move(-50, 75);

}
void moveUpRight() {
currRow--;
sprite->Move(50, -75);

}
void moveUpLeft() {
currRow--;
currCol--;
sprite->Move(-50, -75);
}

void PrintPos() {
Expand All @@ -84,7 +86,7 @@ class Qbert {
return film;
}

void Animation() { //!!!!!!!! gia test einai ayth h method
/*void Animation() { //!!!!!!!! gia test einai ayth h method
std::list<PathEntry> path;
PathEntry *p;
for (int i = 0; i < 4; ++i) {
Expand All @@ -95,7 +97,7 @@ class Qbert {
MovingPathAnimation* qbertAnimation = new MovingPathAnimation(path, "qbert_Animation1");
MovingPathAnimator* qbertAnimator = new MovingPathAnimator(sprite, qbertAnimation);
qbertAnimator->Start(game->GetGameTime());
}
}*/

Qbert(int x, int y){
Create(x,y);
Expand Down

0 comments on commit 7a9c002

Please sign in to comment.