projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added phonies to make, added fps to debug
[physics.git]
/
src
/
game.cpp
diff --git
a/src/game.cpp
b/src/game.cpp
index
32a9e0b
..
1aabda2
100644
(file)
--- a/
src/game.cpp
+++ b/
src/game.cpp
@@
-1,10
+1,11
@@
+#include "game.h"
+#include "debug.h"
+
#include <vector>
using std::vector;
#include <vector>
using std::vector;
-#include "game.h"
-
-#include "debug.h"
#include "entityCreator.h"
#include "entityCreator.h"
+#include "effectManager.h"
#include "GameStates/GameState.h"
#include "GameStates/Running.h"
#include "GameStates/GameState.h"
#include "GameStates/Running.h"
@@
-31,9
+32,12
@@
void gameInit()
creating_Polygon = new CreatingPolygon();
// create starting entities
creating_Polygon = new CreatingPolygon();
// create starting entities
-
creator::init();
creator::init();
+ active_States.push_back(running);
+
+ effect::init();
+
#ifdef DEBUGGING
cout << "World Created" << endl;
#endif
#ifdef DEBUGGING
cout << "World Created" << endl;
#endif
@@
-41,6
+45,8
@@
void gameInit()
void gameClean()
{
void gameClean()
{
+ effect::clean();
+
creator::clean();
delete creating_Polygon;
creator::clean();
delete creating_Polygon;
@@
-50,27
+56,26
@@
void gameClean()
void gameInput()
{
void gameInput()
{
- int
size = active_States.size()
;
+ int
last = active_States.size() -1
;
for( int i = 0;
for( int i = 0;
- i <
size
;
+ i <
= last
;
i++ )
{
i++ )
{
- if( i
-1 == size
)
+ if( i
== last
)
active_States[i]->handleInput(true);
else
active_States[i]->handleInput(false);
}
active_States[i]->handleInput(true);
else
active_States[i]->handleInput(false);
}
-
}
void gameUpdate(float time_step)
{
}
void gameUpdate(float time_step)
{
- int
size = active_States.size()
;
+ int
last = active_States.size() -1
;
for( int i = 0;
for( int i = 0;
- i <
size
;
+ i <
= last
;
i++ )
{
i++ )
{
- if( i
-1 == size
)
+ if( i
== last
)
active_States[i]->update(time_step, true);
else
active_States[i]->update(time_step, false);
active_States[i]->update(time_step, true);
else
active_States[i]->update(time_step, false);
@@
-79,12
+84,12
@@
void gameUpdate(float time_step)
void gameDraw()
{
void gameDraw()
{
- int
size = active_States.size()
;
+ int
last = active_States.size() -1
;
for( int i = 0;
for( int i = 0;
- i <
size
;
+ i <
= last
;
i++ )
{
i++ )
{
- if( i
-1 == size
)
+ if( i
== last
)
active_States[i]->draw(true);
else
active_States[i]->draw(false);
active_States[i]->draw(true);
else
active_States[i]->draw(false);