From bb5bf44283e1ca2a3cc306f557cef5dbc8c20a22 Mon Sep 17 00:00:00 2001 From: Marek Moeckel Date: Mon, 4 Apr 2005 15:22:53 +0000 Subject: [PATCH] added MrRocket badguy and added him to the Dispenser. Try in the NolokTest level SVN-Revision: 2326 --- data/images/shared/mrrocket-0.png | Bin 0 -> 3081 bytes data/images/shared/mrrocket-collision.png | Bin 0 -> 1805 bytes data/images/shared/mrrocket-explosion-1.png | Bin 0 -> 6173 bytes data/images/shared/mrrocket-explosion.png | Bin 0 -> 11786 bytes data/images/shared/mrrocket-squished.png | Bin 0 -> 1777 bytes data/images/supertux.strf | 57 +++++++++++++++++++- data/levels/test/noloktest.stl | 2 +- src/badguy/dispenser.cpp | 35 ++++-------- src/badguy/dispenser.h | 1 - src/badguy/mrrocket.cpp | 81 ++++++++++++++++++++++++++++ src/badguy/mrrocket.h | 27 ++++++++++ src/badguy/rocketexplosion.cpp | 68 +++++++++++++++++++++++ src/badguy/rocketexplosion.h | 24 +++++++++ 13 files changed, 268 insertions(+), 27 deletions(-) create mode 100644 data/images/shared/mrrocket-0.png create mode 100644 data/images/shared/mrrocket-collision.png create mode 100644 data/images/shared/mrrocket-explosion-1.png create mode 100644 data/images/shared/mrrocket-explosion.png create mode 100644 data/images/shared/mrrocket-squished.png create mode 100644 src/badguy/mrrocket.cpp create mode 100644 src/badguy/mrrocket.h create mode 100644 src/badguy/rocketexplosion.cpp create mode 100644 src/badguy/rocketexplosion.h diff --git a/data/images/shared/mrrocket-0.png b/data/images/shared/mrrocket-0.png new file mode 100644 index 0000000000000000000000000000000000000000..4c04c06ee75441fb4dd5850e34890174fcb74d66 GIT binary patch literal 3081 zcmV+k4EFPhP)WFU8GbZ8({Xk{QrNlj4iWF>9@01ItNL_t(|+U=QpY*g2s z$G`X7JNGen-eZq3_PAry;MS0kV5dv8$&wZViI$K}6IMyJD60BLv?Bkk5Sv6*8zrjL zZlti?4ZGPWNtI9~l%-O)>Vv`(5n~5RcqD6TjCqY;Gxj`~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DWt9yb5Q9v9(j>Kc!olzy9#Wf+erp}#* z``_h>FErrUl*d2x68ys3@ca?3V_f1Ze3mbSf8-qsTW^HW;wWpx1johj##?#qQBA)D zd|5o-ZM(lv&?JQkZCzF*uF5nU0wUMx?(mrGoTi9-g2pBAc`0XF^>w@#$VELH-(RxH zr#N5Vc(%NQLbH&khy7vs(ublKGaLLSGxLvo>N$HNQ#Bq})ze9yX6i?Wb*!2 zdR2P&?%u2-I>4fty(yQwsFZk@e&;dZn`XAO-SHq=z*X{T3xDs8pn!Bz^wK^lBo-z| zfCoiXY>Rnn#_y`)(wpM<9#V|B0Q}g@wzV!uU1M`Wiing|CcnI{fb@idR7L+ECchKx zn`U-?n^&eS<~jEE?^jG1W%G?ox1@l0qa$;^);6=tQp{E0*JTZHNBAi4tH5X3VrRyU zwy*_rlY&fZr0KxxFBzOM&Mzx%qY2b}Jz6^Ish>NSy(`2z*rv z>5$(5?Sr>EtgwmlZ`*wZBheT)ByD*!0-5=YIQuUO5jM$hl6r6_OWEy;0V_&v?HlyZ zIW;cll_AP%s9o79HfOsOFyksTyFve4G_&Vb+)O(j?`O&aUJx&TQvgFG<~hM+V~6eu vzHJXPd!Lz2|E&4$b}C@(c0})=mB;@9msFH5edK-200000NkvXXu0mjf?#8mW literal 0 HcmV?d00001 diff --git a/data/images/shared/mrrocket-explosion.png b/data/images/shared/mrrocket-explosion.png new file mode 100644 index 0000000000000000000000000000000000000000..37f1a7b8bcc8259279cc8cf8838f151ca7f5de9e GIT binary patch literal 11786 zcmV+lF7?rgP)WFU8GbZ8({Xk{QrNlj4iWF>9@03ZNKL_t(|+U333kEO?z zANV^F@vV2?bI+{3idDr`6xnJ@v|GK{7#M>AEX|wY7rz*Azs-{|V+ruf0P|$~FK8Hp z83;3;_JWqX+buOMxg}BDimWQu!m7$WZ{B_T_AkynWRyCa!=*@(Z1nU8T-?g6x|wlK zoaJ|Z=R_1SvjETp@Em}10Nw=f3jj<+jQ^iM0ssN90n`Dk0O$aa_*?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2d<;e+k?!Y#x4x80 z`8Z0K9FSrWAOwu#@P073Zo+CsAP`t8?@x-j_X2=hmE zFWKKak7^jGw^(qwSVRNQBPU5PO%t*#BVQ^39Jfq_3jojapr!#$*WvXCxD_XW5TeHc zV_Q=bb5crRns)*+O)vl|rSNMSroCR6cb|QV;QK^btr)X8P_kH1V=KdnJF)4y{;771 zG4MQ(OSv4@6beXb8s?l%I6WQ+f`DHF=rT=+h54jeeJiJO=RIS6^$!PsgKAsn&WjhV$o^|oQ$q@p;pzP;U7RaNx^MNurDCHyYa z)6>|UP9tNQuv#prTU^9gD1=)!+kL`6dDnFvUD+%YP!vl#Qc@kumrBzN7zl~t#w~Mm z!RE-wN-6AiJ7cDqtIOx3nNsOeLf0>H9QWr77cLYI z9XjOEb$zd2QC{mTl{);f7+1F2apDVWaCtH|J2LS8QvjwPY9Day*s-T|UH@J(ncODJ zvPV%Aj#5hQtpbkY&{$iGtceAh=urA^Ad~kOpws?RF0- zit<;}G(Ya|?=Lh8g!=lfpWlq0zdm~9%}3S=o;r2PHa0f4 zmQvc9PN&xwi^Xb9)0zr}f=CFd<~XjVrlzK5b3W(wDGS6+2n<00L=l&rt`Fuc*1j7z zZe0Cfc=%%g833QFB_0_W;Wlj8K>uq#H&2{6!R_6set_action("broken"); dispense_timer.start(0); player.bounce(*this); + kill_squished(player); return true; } @@ -55,38 +57,23 @@ Dispenser::active_action(float ) } } -HitResponse -Dispenser::collision_solid(GameObject& , const CollisionHit& hit) -{ - if(fabsf(hit.normal.y) > .5) { // hit floor or roof? - physic.set_velocity_y(0); - } else { // hit right or left - dir = dir == LEFT ? RIGHT : LEFT; - sprite->set_action(dir == LEFT ? "left" : "right"); - physic.set_velocity_x(-physic.get_velocity_x()); - } - - return CONTINUE; -} - -//TODO: Add launching velocity to badguys -// Add randomizer -// Clean up stuff I copied without understanding what it does :) -// Stop dispensing when game is paused (timer related problem) -// Lots-O-Stuff (tm) +//TODO: Add launching velocity to certain badguys +// Add randomizer (themed to match tileset) void Dispenser::launch_badguy() { //FIXME: Does is_offscreen() work right here? if (!is_offscreen()) { if (badguy == "snowball") - Sector::current()->add_object(new SnowBall(get_pos().x, get_pos().y, dir)); + Sector::current()->add_object(new SnowBall(get_pos().x, get_pos().y+32, dir)); else if (badguy == "bouncingsnowball") - Sector::current()->add_object(new BouncingSnowball(get_pos().x, get_pos().y, dir)); + Sector::current()->add_object(new BouncingSnowball(get_pos().x, get_pos().y+32, dir)); else if (badguy == "mrbomb") - Sector::current()->add_object(new MrBomb(get_pos().x, get_pos().y, dir)); + Sector::current()->add_object(new MrBomb(get_pos().x, get_pos().y+32, dir)); else if (badguy == "mriceblock") - Sector::current()->add_object(new MrIceBlock(get_pos().x, get_pos().y, dir)); + Sector::current()->add_object(new MrIceBlock(get_pos().x, get_pos().y+32, dir)); + else if (badguy == "mrrocket") + Sector::current()->add_object(new MrRocket(get_pos().x, get_pos().y+32, dir)); else if (badguy == "random") {} } diff --git a/src/badguy/dispenser.h b/src/badguy/dispenser.h index 3dd24899e..a749885cc 100644 --- a/src/badguy/dispenser.h +++ b/src/badguy/dispenser.h @@ -11,7 +11,6 @@ public: void activate(); void write(lisp::Writer& writer); - HitResponse collision_solid(GameObject& other, const CollisionHit& hit); void active_action(float elapsed_time); protected: diff --git a/src/badguy/mrrocket.cpp b/src/badguy/mrrocket.cpp new file mode 100644 index 000000000..1c2a95564 --- /dev/null +++ b/src/badguy/mrrocket.cpp @@ -0,0 +1,81 @@ +#include + +#include "mrrocket.h" + +static const float SPEED = 200; + +MrRocket::MrRocket(const lisp::Lisp& reader) +{ + reader.get("x", start_position.x); + reader.get("y", start_position.y); + bbox.set_size(31.8, 31.8); + sprite = sprite_manager->create("mrrocket"); + set_direction = false; +} + +MrRocket::MrRocket(float pos_x, float pos_y, Direction d) +{ + start_position.x = pos_x; + start_position.y = pos_y; + bbox.set_size(31.8, 31.8); + sprite = sprite_manager->create("mrrocket"); + set_direction = true; + initial_direction = d; +} + +void +MrRocket::write(lisp::Writer& writer) +{ + writer.start_list("mrrocket"); + + writer.write_float("x", start_position.x); + writer.write_float("y", start_position.y); + + writer.end_list("mrrocket"); +} + +void +MrRocket::activate() +{ + if (set_direction) {dir = initial_direction;} + physic.set_velocity_x(dir == LEFT ? -SPEED : SPEED); + physic.enable_gravity(false); + sprite->set_action(dir == LEFT ? "left" : "right"); +} + +void +MrRocket::active_action(float elapsed_time) +{ + if (collision_timer.check()) { + Sector::current()->add_object(new RocketExplosion(get_pos(), dir)); + kill_fall(); + } + else if (!collision_timer.started()) { + movement=physic.get_movement(elapsed_time); + sprite->set_action(dir == LEFT ? "left" : "right"); + } +} + +bool +MrRocket::collision_squished(Player& player) +{ + sprite->set_action(dir == LEFT ? "squished-left" : "squished-right"); + kill_squished(player); + return true; +} + +HitResponse +MrRocket::collision_solid(GameObject& , const CollisionHit& hit) +{ + if(fabsf(hit.normal.y) > .5) { // hit floor or roof? + physic.set_velocity_y(0); + } else { // hit right or left + sprite->set_action(dir == LEFT ? "collision-left" : "collision-right"); + physic.set_velocity_x(0); + collision_timer.start(0.2, true); + } + + return CONTINUE; +} + +IMPLEMENT_FACTORY(MrRocket, "mrrocket") diff --git a/src/badguy/mrrocket.h b/src/badguy/mrrocket.h new file mode 100644 index 000000000..4582a04a8 --- /dev/null +++ b/src/badguy/mrrocket.h @@ -0,0 +1,27 @@ +#ifndef __MRROCKET_H__ +#define __MRROCKET_H__ + +#include "badguy.h" +#include "timer.h" +#include "rocketexplosion.h" + +class MrRocket : public BadGuy +{ +public: + MrRocket(const lisp::Lisp& reader); + MrRocket(float pos_x, float pos_y, Direction d); + + void activate(); + void active_action(float elapsed_time); + void write(lisp::Writer& writer); + HitResponse collision_solid(GameObject& other, const CollisionHit& hit); + +protected: + bool collision_squished(Player& player); + bool set_direction; + Direction initial_direction; + Timer2 collision_timer; +}; + +#endif + diff --git a/src/badguy/rocketexplosion.cpp b/src/badguy/rocketexplosion.cpp new file mode 100644 index 000000000..e7aaed36a --- /dev/null +++ b/src/badguy/rocketexplosion.cpp @@ -0,0 +1,68 @@ +#include + +#include "rocketexplosion.h" + +static const float EXPLOSIONTIME = 1; + +RocketExplosion::RocketExplosion(const Vector& pos, Direction dir) +{ + start_position = pos; + bbox.set_pos(pos); + bbox.set_size(31.8, 31.8); + sprite = sprite_manager->create("rocketexplosion"); + this->dir = dir; + explode(); +} + +void +RocketExplosion::write(lisp::Writer& ) +{ + // bombs are only temporarily so don't write them out... +} + +HitResponse +RocketExplosion::collision_solid(GameObject& , const CollisionHit& hit) +{ + if(fabsf(hit.normal.y) > .5) + physic.set_velocity_y(0); + + return CONTINUE; +} + +HitResponse +RocketExplosion::collision_player(Player& player, const CollisionHit& ) +{ + player.kill(Player::SHRINK); + return ABORT_MOVE; +} + +HitResponse +RocketExplosion::collision_badguy(BadGuy& badguy, const CollisionHit& ) +{ + badguy.kill_fall(); + return ABORT_MOVE; +} + +void +RocketExplosion::active_action(float elapsed_time) +{ + if(timer.check()) { + remove_me(); + } +} + +void +RocketExplosion::explode() +{ + sprite->set_action(dir == LEFT ? "explosion-left" : "explosion-right"); + SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(), + Sector::current()->player->get_pos()); + timer.start(EXPLOSIONTIME, true); +} + +void +RocketExplosion::kill_fall() +{ + explode(); +} + diff --git a/src/badguy/rocketexplosion.h b/src/badguy/rocketexplosion.h new file mode 100644 index 000000000..ffa2dee8b --- /dev/null +++ b/src/badguy/rocketexplosion.h @@ -0,0 +1,24 @@ +#ifndef __BOMB_H__ +#define __BOMB_H__ + +#include "badguy.h" + +class RocketExplosion : public BadGuy +{ +public: + RocketExplosion(const Vector& pos, Direction dir); + + void write(lisp::Writer& writer); + HitResponse collision_solid(GameObject& other, const CollisionHit& hit); + HitResponse collision_player(Player& player, const CollisionHit& hit); + HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit); + void active_action(float elapsed_time); + void kill_fall(); + void explode(); + +private: + Timer2 timer; +}; + +#endif + -- 2.11.0