Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1476/src
Modified Files:
defines.h world.cpp
Log Message:
Limitated the number of bullets to be shot at the same time.
I have made 2 bullets to be the maximum... if you don't agree tell me. anyway, you can easily change them in defines.h
Index: defines.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/defines.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- defines.h 20 Apr 2004 19:55:02 -0000 1.19
+++ defines.h 21 Apr 2004 22:48:30 -0000 1.20
@@ -70,6 +70,8 @@
#define RUN_SPEED 1.5
#define JUMP_SPEED 1.2
+#define MAX_BULLETS 2
+
#define GRAVITY 1.0
#define YM_FOR_JUMP 6.0
#define WALK_ACCELERATION_X 0.03
Index: world.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- world.cpp 20 Apr 2004 20:10:52 -0000 1.33
+++ world.cpp 21 Apr 2004 22:48:43 -0000 1.34
@@ -399,6 +399,9 @@
void
World::add_bullet(float x, float y, float xm, Direction dir)
{
+ if(bullets.size() > MAX_BULLETS-1)
+ return;
+
Bullet new_bullet;
new_bullet.init(x,y,xm,dir);
bullets.push_back(new_bullet);
|