Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #pragma once
  2. #include <SFML\Graphics.hpp>
  3. #include "Animation.h"
  4. #include "Collider.h"
  5.  
  6. class Player
  7. {
  8. public:
  9. Player(sf::Texture* texture, sf::Vector2u imageCount, float switchTime, int maxCount, float speed);
  10. ~Player();
  11. Collider& getCollider() {
  12.     return m_myCollider;
  13. }
  14. void Update(float deltaTime);
  15. void Draw(sf::RenderWindow& window); //new draw instance so we dont have to use a getter in out main.cpp for the players
  16.  
  17. sf::Vector2f GetPosition() {
  18.     return body.getPosition();
  19. }
  20. Collider & GetCollider() {
  21.     return Collider(body);
  22. }
  23.  
  24.  
  25. private:
  26. sf::RectangleShape body;
  27. Animation animation;
  28. unsigned int row;
  29. float speed;
  30. bool faceRight;
  31. Collider m_myCollider;
  32. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement