/******************************************************************** File: bus.h Author: Dana Vrajitoru Description: A class handling a bus moving around. Project: A sprite moving through a maze application. Last updated: February 10, 2011. ********************************************************************/ #ifndef BUS_H #define BUS_H enum Direction {north=0, west, south, east}; const int busid = 1; // Draws a polygon with given array of coordinates, void polygon(GLfloat coords[][2], float offx, float offy, int n); // Returns the opposite of a given direction. Direction opposite(Direction w); class Bus { public: // The bus's position float x, y; // Orientation of the bus Direction orient; // Default constructor. Not much to do. Everything will be done in // the init function. Bus(); // Draw the object and store it in the display list. We also need to // be able to give it an initial position. void init(float posx=0, float posy=0); // Move the bus from the current position by one unit in the given // direction void move(Direction where); // Draw the bus at given coordinates by just applying some // transformations and calling the display list. void draw(); }; #endif