#ifndef ENGINE_H #define ENGINE_H #include "enginecore.h" #include "GUI.h" #define LEVEL_COMPLETED 2 #define LEVEL_FAILED 1 using namespace std; class Account: public Levelable { public: string name; double gold; long long highscore; //owned ships vector ships; //the ship currently used int current; //owned weapons that are not in ships vector weapons; //list of succesfully played levels vector levels; Account(); Account(string filename); ~Account(); void save(); void resetShips(); }; //game engine. deletes everything it gets besides account and screen class ObjectHandler { protected: list friendlyProjectiles; list enemyProjectiles; list enemies; public: SlidingBackground* BG; long long highscore; double gold; Account* user; SDL_Surface* screen; ObjectHandler(Account* newuser,SDL_Surface* newscreen, SDL_Surface *background); ~ObjectHandler(); int frame(double time); void frameEnemy(EnemyShip* s, double time); void spawnEnemy(EnemyShip* enemy,double nx, double ny); }; class HUD { SDL_Surface* energyRaw; SlidingBackground* energyBubbles; SDL_Surface* energyMasc; double Bubblesypos; SDL_Surface* hpRaw; SDL_Surface* hpMasc; SDL_Surface *background; TTF_Font *font; public: long long* highscore; double* hp; double hpmax; double* energy; double maxEnergy; double *gold; double *exp; SDL_Color textColor; HUD(long long *nhighscore, double *nhp, double nhpmax, double *nenergy, double nmaxEnergy, double* ngold, double* nexp); ~HUD(); void draw(SDL_Surface *screen); }; class LevelEvent { }; LevelEvent* createEvent(ifstream& ins); class LevelGenerator { Uint32 seed; HUD *hud; //collects the soundfiles that have been loaded and cleans them vector toDelete; public: //what ships will come in the Level -bosses vector prototypes; vector > events; //duration of the level -bosses double duration; //[(spawn%,(enemytype,path))] of each enemy vector > > > > spawnQueue; int current; //if there is currently an event happening bool event; //% of level completed double completed; ObjectHandler* OH; string name; SDL_Surface* screen; LevelGenerator(string filename, Account* user, SDL_Surface* screen); ~LevelGenerator(); int frame(double time); }; vector > > > generateWave(int number, int Nweapons,SDL_Surface* screen); #endif