From: Ingo Ruhnke Date: Wed, 24 Mar 2004 22:01:08 +0000 (+0000) Subject: - minor cleanup X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2da2bc9933b7d8123fe1983daaea1b32868f4628;p=supertux.git - minor cleanup SVN-Revision: 341 --- diff --git a/src/badguy.cpp b/src/badguy.cpp index 06668d52d..9b3384be3 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -64,9 +64,7 @@ void BadGuy::action_bsod() 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 @@ void BadGuy::action_bsod() } /* Fall if we get off the ground: */ - if (dying != DYING_FALLING) { if (!issolid(base.x+16, base.y + 32)) @@ -124,16 +121,14 @@ void BadGuy::action_bsod() base.ym = physic_get_velocity(&physic); } + // BadGuy fall below the ground if (base.y > screen->h) bad_guys.erase(static_cast::iterator>(this)); } void BadGuy::action_laptop() { - /* --- LAPTOP MONSTER: --- */ - /* Move left/right: */ - if (mode == NORMAL || mode == KICK) { if (dying == DYING_NOT || @@ -181,7 +176,6 @@ void BadGuy::action_laptop() /* Move vertically: */ - if(mode != HELD) base.y = base.y + base.ym * frame_ratio; @@ -218,9 +212,7 @@ void BadGuy::action_laptop() } - /* 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_laptop() void BadGuy::action_money() { - /* --- MONEY BAGS: --- */ - - /* Move vertically: */ - base.y = base.y + base.ym * frame_ratio; if (dying != DYING_FALLING) diff --git a/src/badguy.h b/src/badguy.h index 9a1869acc..f2919a161 100644 --- a/src/badguy.h +++ b/src/badguy.h @@ -70,11 +70,12 @@ class BadGuy 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); diff --git a/src/scene.cpp b/src/scene.cpp index 2309a1e6d..897873bcc 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -34,16 +34,19 @@ std::vector floating_scores; std::vector upgrades; std::vector 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 @@ void set_defaults(void) 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 @@ void add_score(float x, float y, int s) floating_scores.push_back(new_floating_score); } -/* Add a bouncy distro: */ - void add_bouncy_distro(float x, float y) { @@ -96,9 +93,6 @@ void add_bouncy_distro(float x, float y) 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 @@ void add_broken_brick(float x, float y) 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 @@ void add_broken_brick_piece(float x, float y, float xm, float ym) 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 @@ void add_bouncy_brick(float x, float y) 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 @@ void add_bad_guy(float x, float y, BadGuyKind kind) 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 @@ void add_upgrade(float x, float y, int dir, int kind) 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 @@ void add_bullet(float x, float y, float xm, int dir) play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER); } +// EOF // + diff --git a/src/scene.h b/src/scene.h index a77fb6428..7947d4dfd 100644 --- a/src/scene.h +++ b/src/scene.h @@ -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;