// CSE 143 // Homework 5 // http://www.cs.washington.edu/education/courses/143/00su/homework/ // 30 Jul 2000, Ken Yasuhara // class Projectile // // MovingObject whose motion is affected by gravity (constant // downward acceleration) #ifndef _PROJECTILE_H_ #define _PROJECTILE_H_ #include "movingobject.h" // in y direction only (obviously); in pixels per frame update^2 const double ACCEL_GRAVITY = -0.5; class Projectile : public MovingObject { public: Projectile(const double newX, const double newY, const double newVx, const double newVy) : MovingObject(newX, newY, newVx, newVy) {} virtual void getNextPosition(double &nextX, double &nextY); virtual void paint(GP142Display &display) const = 0; protected: // effectively disallow public use of default constructor Projectile() {} }; #endif // _PROJECTILE_H_