/********************************************************************************** *** FILE: movingobject.cpp *** DATE: Jan 14, 2004 *** AUTHOR: Daniel Dementiev *** GOAL: This is a short example illustrating how to split a class definition *** into separate files. *** Designed for IST482 class. **********************************************************************************/ #include "movingobject.h" MovingObject::MovingObject() { x = y = 0; speed = 1; dir = South; } void MovingObject::step() { switch( dir ){ case North: y += speed; break; case West: x -= speed; break; case South: y -= speed; break; case East: x += speed; break; } } /* ****************************************************************************** */