// CSE 143 // Homework 5 // http://www.cs.washington.edu/education/courses/143/00su/homework/ // 30 Jul 2000, Ken Yasuhara // class TimedProjectile // // Projectile with a built-in timer that advances once per frame // update; allows behavior to change depending on time #ifndef _TIMEDPROJECTILE_H_ #define _TIMEDPROJECTILE_H_ #include "projectile.h" class TimedProjectile : public Projectile { public: TimedProjectile(const double newX, const double newY, const double newVx, const double newVy) : Projectile(newX, newY, newVx, newVy), frameCount(0) {} virtual void updatePosition(); // returns number of frames updated since object's creation int getFrameCount() const { return frameCount; } virtual void paint(GP142Display &display) const = 0; protected: // effectively disallow public use of default constructor TimedProjectile() {} private: // starts at 0; incr. each time updatePosition is called int frameCount; }; #endif // _TIMEDPROJECTILE_H_