Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #ifndef PLAYGAME_STATE_H
  2. #define PLAYGAME_STATE_H
  3. #include <SFML/Graphics.hpp>
  4. #include <iostream>
  5. #include <vector>
  6.  
  7. class PlayGame_State
  8. {
  9. sf::RectangleShape *player; //player shape
  10. sf::RectangleShape *ball; //ball shape
  11. sf::Vector2f ballSpeed;
  12. sf::Vector2i bricksPosition;
  13. sf::Clock clock_for_ps; //clock for player speed
  14. sf::Clock clock_for_bs; //clock for ball speed
  15. sf::RectangleShape bricks[40];
  16. std::vector<sf::RectangleShape*> v_bricks; //bricks
  17. float playerSpeed;
  18. int amountOfBricks, player_score;
  19. sf::Text score;
  20. sf::Font font;
  21. public:
  22. PlayGame_State(sf::RectangleShape &rectShape, sf::RectangleShape &ballShape, sf::Font &f);
  23. void movePlayer();
  24. void moveBall();
  25. void checkPosition();
  26. bool collisionBallPlayer(const sf::RectangleShape &player_rect, const sf::RectangleShape &ball_rect) const;
  27. bool collisionBallBrick();
  28. void updateScore();
  29. void draw(sf::RenderWindow *window) const;
  30. };
  31.  
  32. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement