// CSE 143 // Homework 5 // http://www.cs.washington.edu/education/courses/143/00su/homework/ // 30 Jul 2000, Ken Yasuhara // class BasicFirework #ifndef _BASICFIREWORK_H_ #define _BASICFIREWORK_H_ #include "timedprojectile.h" // defaults const double BASICFIREWORK_EXPLOSION_RADIUS = 20; const int BASICFIREWORK_EXPLOSION_DURATION = 3; const int BASICFIREWORK_EXPLOSION_MASS = 100; class BasicFirework : public TimedProjectile { public: BasicFirework(const double newX, const double newY, const double newVx, const double newVy, const double newRadius = BASICFIREWORK_EXPLOSION_RADIUS, const int newMass = BASICFIREWORK_EXPLOSION_MASS, const int newDuration = BASICFIREWORK_EXPLOSION_DURATION); // explosion happens when rocket passes highest point virtual void updatePosition(); virtual void paint(GP142Display &display) const; protected: virtual void paintRocket(GP142Display &display) const = 0; void paintExplosion(GP142Display &display) const; virtual void paintExplosionFlash(GP142Display &display, const int x, const int y) const = 0; // number of frames since explosion int explosionTime; const double radius; const int duration, mass; }; #endif // _BASICFIREWORK_H_