Advertisement
aLTis

Untitled

Oct 23rd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. void PlayerTest()
  2. {
  3.     PlayerShip *player;
  4.     player = new PlayerShip(3, 1);
  5.     player->moveLeft();
  6.     int x_coord1 = player->getX();
  7.     player->moveRight();
  8.     if(x_coord1 == 2 && player->getX() == 3)
  9.         cout << "Player move test passed..." << endl;
  10.     else
  11.     {
  12.         cout << "Player move test failed!" << endl;
  13.         return;
  14.     }
  15.     int lives = player->getLives();
  16.     player->removeLife();
  17.     if(player->getLives() == lives-1)
  18.         cout << "Player health test passed..." << endl;
  19.     else
  20.         cout << "Player health test failed!" << endl;
  21.     delete player;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement