Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include "Bullet.hpp"
  2.  
  3. Bullet::Bullet(float tspeed)
  4.     :   speed(tspeed),
  5.         velocity(0.0f, 0.0f)
  6. {
  7.     bullet.setRadius(5.f);
  8.     bullet.setFillColor(sf::Color::Red);
  9. }
  10.  
  11. void Bullet::update(const float &dt)
  12. {
  13.     bullet.move(velocity * dt);
  14. }
  15.  
  16. void Bullet::draw(sf::RenderTexture &gameTexture)
  17. {
  18.     gameTexture.draw(bullet);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement