projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddec157
)
Limitated the number of bullets to be shot at the same time.
author
Ricardo Cruz
<rick2@aeiou.pt>
Wed, 21 Apr 2004 22:48:43 +0000
(22:48 +0000)
committer
Ricardo Cruz
<rick2@aeiou.pt>
Wed, 21 Apr 2004 22:48:43 +0000
(22:48 +0000)
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
SVN-Revision: 617
src/defines.h
patch
|
blob
|
history
src/world.cpp
patch
|
blob
|
history
diff --git
a/src/defines.h
b/src/defines.h
index
7d9173f
..
258d786
100644
(file)
--- a/
src/defines.h
+++ b/
src/defines.h
@@
-70,6
+70,8
@@
enum DyingType {
#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
diff --git
a/src/world.cpp
b/src/world.cpp
index
f43d3e1
..
e9c5bb1
100644
(file)
--- a/
src/world.cpp
+++ b/
src/world.cpp
@@
-399,6
+399,9
@@
World::add_upgrade(float x, float y, Direction dir, UpgradeKind kind)
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);