Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PLAYGAME_STATE_H
- #define PLAYGAME_STATE_H
- #include <SFML/Graphics.hpp>
- #include <iostream>
- #include <vector>
- class PlayGame_State
- {
- sf::RectangleShape *player; //player shape
- sf::RectangleShape *ball; //ball shape
- sf::Vector2f ballSpeed;
- sf::Vector2i bricksPosition;
- sf::Clock clock_for_ps; //clock for player speed
- sf::Clock clock_for_bs; //clock for ball speed
- sf::RectangleShape bricks[40];
- std::vector<sf::RectangleShape*> v_bricks; //bricks
- float playerSpeed;
- int amountOfBricks, player_score;
- sf::Text score;
- sf::Font font;
- public:
- PlayGame_State(sf::RectangleShape &rectShape, sf::RectangleShape &ballShape, sf::Font &f);
- void movePlayer();
- void moveBall();
- void checkPosition();
- bool collisionBallPlayer(const sf::RectangleShape &player_rect, const sf::RectangleShape &ball_rect) const;
- bool collisionBallBrick();
- void updateScore();
- void draw(sf::RenderWindow *window) const;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement