Laser.cpp 779 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "Laser.h"
  2. #include "Karte.h"
  3. // Inhalt der Laser Klasse aus Laser.h
  4. // Konstruktor
  5. Laser::Laser( int id, Vec2< double > pos, Vec2< double > speed, int sNum, double intensity )
  6. : Object2D()
  7. {
  8. this->id = id;
  9. setPosition( pos );
  10. setSpeed( speed );
  11. this->sNum = sNum;
  12. this->intensity = intensity;
  13. }
  14. // nicht constant
  15. bool Laser::tick( const WeltInfo &info, double tickVal )
  16. {
  17. Object2D::tick( info, tickVal );
  18. intensity -= tickVal * 2;
  19. return 0;
  20. }
  21. void Laser::render( Mat3< float > &kamMat, Bild &zRObj )
  22. {}
  23. // constant
  24. Rect2< float > Laser::getBoundingBox() const
  25. {
  26. return Rect2< float >();
  27. }
  28. int Laser::getId() const
  29. {
  30. return id;
  31. }
  32. int Laser::getSpieler() const
  33. {
  34. return sNum;
  35. }
  36. double Laser::getIntensity() const
  37. {
  38. return intensity;
  39. }