Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Paddle.h"
- #include "HumanPaddle.h"
- #include "ComputerPaddle.h"
- #include "Player.h"
- #include "Human.h"
- #include "Computer.h"
- #include "Ball.h"
- #include <SFML/Graphics.hpp>
- #include <SFML/Audio.hpp>
- using namespace sf;
- Human::Human(RenderWindow * App, int playerID) : Player (App, playerID)
- {
- this->paddle = new HumanPaddle(App, playerID);
- }
- Computer::Computer(RenderWindow * App, int playerID, Ball * ball) : Player (App, playerID)
- {
- this->paddle = new ComputerPaddle(App, playerID, ball);
- }
- void Player::gainPoint(Sound * ScoreSound)
- {
- if (score + 1 <= 99)
- score++;
- ScoreSound->Play();
- }
- void Player::refresh()
- {
- paddle->refresh();
- }
- Sprite Player::getPaddleSprite()
- {
- return paddle->getSprite();
- }
- Sprite * Player::getPaddleSpriteP()
- {
- return paddle->getSpriteP();
- }
Advertisement
Add Comment
Please, Sign In to add comment