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/>.
18 #include "entityCreator.h"
22 #include "entityManager.h"
23 #include "Entities/Ball.h"
24 #include "graphics/colors.h"
26 /// ***** Private Variables *****
28 typedef std::queue<Ball*> queBall;
31 /// ***** Initializers/Cleaners *****
37 ball = new Ball(Vector2(50, 50), 20, cWhite);
39 ball->applyImpulse(Vector2(0.25,0.05)),
43 ball = new Ball(Vector2(100, 50), 20, cBlack);
45 ball->applyImpulse(Vector2(-0.15,-0.05)),
49 ball = new Ball(Vector2(150, 50), 20, cGrey);
51 ball->applyImpulse(Vector2(0.25,0.15)),
55 ball = new Ball(Vector2(50, 100), 20, cRed);
57 ball->applyImpulse(Vector2(0.35,-0.15)),
61 ball = new Ball(Vector2(100, 100), 20, cGreen);
63 ball->applyImpulse(Vector2(-0.15,0.55)),
67 ball = new Ball(Vector2(150, 100), 20, cBlue);
69 ball->applyImpulse(Vector2(0.25,0.15)),
73 ball = new Ball(Vector2(50, 150), 20, cYellow);
75 ball->applyImpulse(Vector2(0.25,-0.05)),
79 ball = new Ball(Vector2(100, 150), 20, cMagenta);
81 ball->applyImpulse(Vector2(-0.15,-0.05)),
85 ball = new Ball(Vector2(150, 150), 20, cCyan);
87 ball->applyImpulse(Vector2(-0.15,0.05)),
96 /// ***** Public Methods *****
98 void creator::addBall()
102 void creator::removeBall()
106 void creator::removeAllBalls()
108 while(! Balls.empty() )
110 Ball* ball = Balls.front();
112 manager::remove(ball);