Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void PlayerTest()
- {
- PlayerShip *player;
- player = new PlayerShip(3, 1);
- player->moveLeft();
- int x_coord1 = player->getX();
- player->moveRight();
- if(x_coord1 == 2 && player->getX() == 3)
- cout << "Player move test passed..." << endl;
- else
- {
- cout << "Player move test failed!" << endl;
- return;
- }
- int lives = player->getLives();
- player->removeLife();
- if(player->getLives() == lives-1)
- cout << "Player health test passed..." << endl;
- else
- cout << "Player health test failed!" << endl;
- delete player;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement