#include "entityCreator.h"
+#include "entityManager.h"
+#include "Entities/Ball.h"
+#include "graphics/colors.h"
+
+/// ***** Private Method Headers *****
+Ball* ball1;
+
+/// ***** Private Variables *****
+
+/// ***** Public Methods *****
void creator::init()
{
+ Vector2 pos(400, 400);
+ ball1 = new Ball(pos, 20, cBlue);
+ manager::add(ball1);
}
void creator::clean()
{
+ manager::remove(ball1);
+ delete ball1;
}
void creator::addBall()
#include <iostream>
#include "entityManager.h"
+#include "debug.h"
+
#include "Entities/Entity.h"
#include "Entities/Particle.h"
#include "Entities/PhysicsEntity.h"
{
(*it)->draw();
}
+
}
/// ***** Private Methods *****
+#include "game.h"
+#include "debug.h"
+
#include <vector>
using std::vector;
-#include "game.h"
-
-#include "debug.h"
#include "entityCreator.h"
#include "GameStates/GameState.h"
creating_Polygon = new CreatingPolygon();
// create starting entities
-
creator::init();
+ active_States.push_back(running);
+
#ifdef DEBUGGING
cout << "World Created" << endl;
#endif
void gameInput()
{
- int size = active_States.size();
+ int last = active_States.size() -1;
for( int i = 0;
- i < size;
+ i <= last;
i++ )
{
- if( i-1 == size )
+ if( i == last )
active_States[i]->handleInput(true);
else
active_States[i]->handleInput(false);
}
-
}
void gameUpdate(float time_step)
{
- int size = active_States.size();
+ int last = active_States.size() -1;
for( int i = 0;
- i < size;
+ i <= last;
i++ )
{
- if( i-1 == size )
+ if( i == last )
active_States[i]->update(time_step, true);
else
active_States[i]->update(time_step, false);
void gameDraw()
{
- int size = active_States.size();
+ int last = active_States.size() -1;
for( int i = 0;
- i < size;
+ i <= last;
i++ )
{
- if( i-1 == size )
+ if( i == last )
active_States[i]->draw(true);
else
active_States[i]->draw(false);