[Super-tux-commit] supertux/src badguy.cpp,1.10,1.11 badguy.h,1.13,1.14 scene.cpp,1.7,1.8 scene.h,1.
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-03-24 22:11:53
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10080 Modified Files: badguy.cpp badguy.h scene.cpp scene.h Log Message: - minor cleanup Index: scene.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- scene.cpp 24 Mar 2004 21:18:08 -0000 1.7 +++ scene.cpp 24 Mar 2004 22:01:08 -0000 1.8 @@ -34,16 +34,19 @@ std::vector<upgrade_type> upgrades; std::vector<bullet_type> bullets; Player tux; -texture_type img_box_full, img_box_empty, img_mints, img_coffee, img_super_bkgd, img_red_glow; +texture_type img_box_full; +texture_type img_box_empty; +texture_type img_mints; +texture_type img_coffee; +texture_type img_super_bkgd; +texture_type img_red_glow; timer_type time_left; double frame_ratio; -/* Initialize all 'dynamic' arrays */ void arrays_init(void) { } -/* Free memory of 'dynamic' arrays */ void arrays_free(void) { bad_guys.clear(); @@ -73,12 +76,8 @@ set_current_music(LEVEL_MUSIC); } -/* Add score: */ - void add_score(float x, float y, int s) { - /* Add the score: */ - score += s; floating_score_type new_floating_score; @@ -86,8 +85,6 @@ floating_scores.push_back(new_floating_score); } -/* Add a bouncy distro: */ - void add_bouncy_distro(float x, float y) { @@ -96,9 +93,6 @@ bouncy_distros.push_back(new_bouncy_distro); } - -/* Add broken brick pieces: */ - void add_broken_brick(float x, float y) { add_broken_brick_piece(x, y, -1, -4); @@ -108,9 +102,6 @@ add_broken_brick_piece(x + 16, y + 16, 1.5, -3); } - -/* Add a broken brick piece: */ - void add_broken_brick_piece(float x, float y, float xm, float ym) { broken_brick_type new_broken_brick; @@ -118,9 +109,6 @@ broken_bricks.push_back(new_broken_brick); } - -/* Add a bouncy brick piece: */ - void add_bouncy_brick(float x, float y) { bouncy_brick_type new_bouncy_brick; @@ -128,9 +116,6 @@ bouncy_bricks.push_back(new_bouncy_brick); } - -/* Add a bad guy: */ - void add_bad_guy(float x, float y, BadGuyKind kind) { BadGuy new_bad_guy; @@ -138,8 +123,6 @@ bad_guys.push_back(new_bad_guy); } -/* Add an upgrade: */ - void add_upgrade(float x, float y, int dir, int kind) { upgrade_type new_upgrade; @@ -147,8 +130,6 @@ upgrades.push_back(new_upgrade); } -/* Add a bullet: */ - void add_bullet(float x, float y, float xm, int dir) { bullet_type new_bullet; @@ -158,3 +139,5 @@ play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER); } +// EOF // + Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- badguy.h 24 Mar 2004 16:12:51 -0000 1.13 +++ badguy.h 24 Mar 2004 22:01:08 -0000 1.14 @@ -70,11 +70,12 @@ void draw(); void action_bsod(); - void action_laptop(); - void action_money(); - void draw_bsod(); + + void action_laptop(); void draw_laptop(); + + void action_money(); void draw_money(); void collision(void* p_c_object, int c_object); Index: scene.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- scene.h 24 Mar 2004 17:41:04 -0000 1.12 +++ scene.h 24 Mar 2004 22:01:08 -0000 1.13 @@ -22,6 +22,7 @@ #include "level.h" #define FRAME_RATE 10 // 100 Frames per second (10ms) + extern int score; extern int distros; extern int level; Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- badguy.cpp 24 Mar 2004 17:41:04 -0000 1.10 +++ badguy.cpp 24 Mar 2004 22:01:08 -0000 1.11 @@ -64,9 +64,7 @@ base.x = base.x - base.xm * frame_ratio; } - /* Move vertically: */ - base.y = base.y + base.ym * frame_ratio; if (dying != DYING_FALLING) @@ -89,7 +87,6 @@ } /* Fall if we get off the ground: */ - if (dying != DYING_FALLING) { if (!issolid(base.x+16, base.y + 32)) @@ -124,16 +121,14 @@ base.ym = physic_get_velocity(&physic); } + // BadGuy fall below the ground if (base.y > screen->h) bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(this)); } void BadGuy::action_laptop() { - /* --- LAPTOP MONSTER: --- */ - /* Move left/right: */ - if (mode == NORMAL || mode == KICK) { if (dying == DYING_NOT || @@ -181,7 +176,6 @@ /* Move vertically: */ - if(mode != HELD) base.y = base.y + base.ym * frame_ratio; @@ -218,9 +212,7 @@ } - /* Fall if we get off the ground: */ - if (dying != DYING_FALLING) { if (!issolid(base.x+16, base.y + 32)) @@ -261,11 +253,7 @@ void BadGuy::action_money() { - /* --- MONEY BAGS: --- */ - - /* Move vertically: */ - base.y = base.y + base.ym * frame_ratio; if (dying != DYING_FALLING) |