1 #ifndef _GHOST_
2 #define _GHOST_
3 
4 #include "SDL.h"
5 #include "SDL_image.h"
6 #include "Defines.h"
7 #include "Level.h"
8 #include "Sprite.h"
9 #include <fstream>
10 #include <vector>
11 
12 using namespace std;
13 
14 class Ghost : public Sprite{
15 	public:
16 		Ghost(char* filename, int x, int y, int speed, AnimationFactory* af);	// Load all sprites in directory
17 		virtual ~Ghost();
18 //		SDL_Surface* frame();
19 		void x(int x);	// Set X
20 		void y(int y);
21 		void setLevel(Level lev, int startx, int starty);
22 		int getfreedirections();
23 		bool testdirection(int dir);
24 		void setRespawn(long time);
25 		void decTimer();
26 		int x();	// Get X
27 		int y();
28 		virtual void move(int x, int y);
29 		int nextxpos;
30 		int nextypos;
31 		int direction; // 1 = up, 2 = right, 3 = down, 4 = left, 5 = stationary
32 		int numframes;
33 		int nextdir;
34 		long timeleft;
35 		char effect; // Used for timeleft, effects are 'flash', 'stop', 'fast', 'slow' etc...
36 		long respawntime;
37 		long timer();
38 		void timer(long timeleft);
39 
40 	//protected:
41 //		vector<SDL_Surface*> frames;
42 		int startx;
43 		int starty;
44 //		int xpos;
45 //		int ypos;
46 //		int currentframe;
47 //		int speed;
48 		Level lev;
49 };
50 
51 #endif
52