added more colors and balls
[physics.git] / src / entityCreator.cpp
CommitLineData
054d658f
PG
1#include "entityCreator.h"
2
f72f4a59
PG
3#include <queue>
4
a483ed75
PG
5#include "entityManager.h"
6#include "Entities/Ball.h"
7#include "graphics/colors.h"
8
9/// ***** Private Method Headers *****
f72f4a59
PG
10typedef std::queue<Ball*> queBall;
11queBall Balls;
a483ed75
PG
12
13/// ***** Private Variables *****
14
15/// ***** Public Methods *****
054d658f
PG
16void creator::init()
17{
f72f4a59
PG
18 Ball* ball;
19
20 // needs to be first for the overlap
21 ball = new Ball(Vector2(50, 50), 20, cWhite);
22
23 Balls.push(ball);
24 manager::add(ball);
25
26 ball = new Ball(Vector2(100, 50), 20, cBlack);
27
28 Balls.push(ball);
29 manager::add(ball);
30
31 ball = new Ball(Vector2(150, 50), 20, cGrey);
32
33 Balls.push(ball);
34 manager::add(ball);
35
36 ball = new Ball(Vector2(50, 100), 20, cRed);
37
38 Balls.push(ball);
39 manager::add(ball);
40
41 ball = new Ball(Vector2(100, 100), 20, cGreen);
054d658f 42
f72f4a59
PG
43 Balls.push(ball);
44 manager::add(ball);
45
46 ball = new Ball(Vector2(150, 100), 20, cBlue);
47
48 Balls.push(ball);
49 manager::add(ball);
50
51 ball = new Ball(Vector2(50, 150), 20, cYellow);
52
53 Balls.push(ball);
54 manager::add(ball);
55
56 ball = new Ball(Vector2(100, 150), 20, cMagenta);
57
58 Balls.push(ball);
59 manager::add(ball);
60
61 ball = new Ball(Vector2(150, 150), 20, cCyan);
62
63 Balls.push(ball);
64 manager::add(ball);
054d658f
PG
65}
66void creator::clean()
67{
f72f4a59 68 removeAllBalls();
054d658f
PG
69}
70
71void creator::addBall()
72{
73
74}
75void creator::removeBall()
76{
77
78}
79void creator::removeAllBalls()
80{
f72f4a59
PG
81 while(! Balls.empty() )
82 {
83 Ball* ball = Balls.front();
84 Balls.pop();
85 manager::remove(ball);
054d658f 86
f72f4a59
PG
87 delete ball;
88 }
054d658f 89}