2 * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "entityCreator.h"
25 #include "effectManager.h"
27 #include "GameStates/GameState.h"
28 #include "GameStates/Running.h"
29 #include "GameStates/Paused.h"
30 #include "GameStates/CreatingPolygon.h"
33 /// ***** Private Variables *****
35 // The stack of active game states
36 vector<GameState*> active_States;
38 // Pointers to each possible game state
39 // inserted and removed from the active_States
42 CreatingPolygon* creating_Polygon;
45 /// ***** Public Methods *****
49 running = new Running();
50 paused = new Paused();
51 creating_Polygon = new CreatingPolygon();
53 // create starting entities
56 active_States.push_back(running);
61 cout << "World Created" << endl;
71 delete creating_Polygon;
78 int last = active_States.size() -1;
84 active_States[i]->handleInput(true);
86 active_States[i]->handleInput(false);
90 void game::update(float time_step)
92 int last = active_States.size() -1;
98 active_States[i]->update(time_step, true);
100 active_States[i]->update(time_step, false);
106 int last = active_States.size() -1;
112 active_States[i]->draw(true);
114 active_States[i]->draw(false);