Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19048/src
Modified Files:
badguy.cpp badguy.h
Log Message:
Changed kill_me() in order to get the score has an argument.
This way, it makes much more flexible the way we give scores.
Index: badguy.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- badguy.h 27 Apr 2004 17:09:35 -0000 1.34
+++ badguy.h 28 Apr 2004 14:09:26 -0000 1.35
@@ -132,7 +132,7 @@
/** this functions tries to kill the badguy and lets him fall off the
* screen. Some badguys like the flame might ignore this.
*/
- void kill_me();
+ void kill_me(int score);
/** remove ourself from the list of badguys. WARNING! This function will
* invalidate all members. So don't do anything else with member after calling
Index: badguy.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- badguy.cpp 28 Apr 2004 12:13:00 -0000 1.55
+++ badguy.cpp 28 Apr 2004 14:09:26 -0000 1.56
@@ -831,7 +831,7 @@
if(kind == BAD_FLAME || kind == BAD_BOMB || kind == BAD_FISH)
return;
- kill_me();
+ kill_me(25);
}
void
@@ -906,16 +906,12 @@
make_player_jump(player);
- if((kind != BAD_MRICEBLOCK && mode != dying))
- {
- World::current()->add_score(base.x - scroll_x, base.y, 25 * player_status.score_multiplier);
- player_status.score_multiplier++;
- }
+ player_status.score_multiplier++;
// check for maximum number of squiches
squishcount++;
if(squishcount >= MAX_ICEBLOCK_SQUICHES) {
- kill_me();
+ kill_me(50);
return;
}
@@ -949,7 +945,7 @@
}
void
-BadGuy::kill_me()
+BadGuy::kill_me(int score)
{
if(kind == BAD_BOMB || kind == BAD_STALACTITE || kind == BAD_FLAME)
return;
@@ -970,12 +966,12 @@
physic.set_velocity_y(0);
/* Gain some points: */
- if (kind == BAD_BSOD)
+// if (kind == BAD_BSOD)
World::current()->add_score(base.x - scroll_x, base.y,
- 50 * player_status.score_multiplier);
- else
+ score * player_status.score_multiplier);
+/* else
World::current()->add_score(base.x - scroll_x, base.y,
- 25 * player_status.score_multiplier);
+ 25 * player_status.score_multiplier);*/
/* Play death sound: */
play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
@@ -1001,7 +997,7 @@
switch (c_object)
{
case CO_BULLET:
- kill_me();
+ kill_me(10);
break;
case CO_BADGUY:
@@ -1010,14 +1006,14 @@
/* If we're a kicked mriceblock, kill any badguys we hit */
if(kind == BAD_MRICEBLOCK && mode == KICK)
{
- pbad_c->kill_me();
+ pbad_c->kill_me(25);
}
// a held mriceblock gets kills the enemy too but falls to ground then
else if(kind == BAD_MRICEBLOCK && mode == HELD)
{
- pbad_c->kill_me();
- kill_me();
+ pbad_c->kill_me(25);
+ kill_me(0);
}
/* Kill badguys that run into exploding bomb */
@@ -1033,14 +1029,14 @@
}
else if (pbad_c->kind != BAD_MRBOMB)
{
- pbad_c->kill_me();
+ pbad_c->kill_me(50);
}
}
/* Kill any badguys that get hit by stalactite */
else if (kind == BAD_STALACTITE && dying == DYING_NOT)
{
- pbad_c->kill_me();
+ pbad_c->kill_me(50);
}
/* When enemies run into eachother, make them change directions */
|