Laser.cpp 807 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "Laser.h"
  2. #include "Karte.h"
  3. // Inhalt der Laser Klasse aus Laser.h
  4. // Konstruktor
  5. Laser::Laser( int id, Vertex pos, Vertex 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. setCollision( 0 );
  14. }
  15. // nicht constant
  16. bool Laser::tick( const WeltInfo &info, double tickVal )
  17. {
  18. Object2D::tick( info, tickVal );
  19. intensity -= tickVal * 2;
  20. return 0;
  21. }
  22. void Laser::render( Mat3< float > &kamMat, Bild &zRObj, const char *kamName )
  23. {}
  24. // constant
  25. Rect2< float > Laser::getBoundingBox() const
  26. {
  27. return Rect2< float >();
  28. }
  29. int Laser::getId() const
  30. {
  31. return id;
  32. }
  33. int Laser::getSpieler() const
  34. {
  35. return sNum;
  36. }
  37. double Laser::getIntensity() const
  38. {
  39. return intensity;
  40. }