From 423b8dbd526fcd127888c1ae380c5057fe070635 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Thu, 16 Mar 2006 20:08:43 +0000 Subject: [PATCH] Fixed sprite, bounding-boxes and behaviour of Mr. Tree SVN-Revision: 3095 --- data/images/creatures/mr_tree/mr_tree.sprite | 12 ++++--- data/images/creatures/mr_tree/squished-left.png | Bin 7329 -> 5609 bytes src/badguy/mrtree.cpp | 46 ++++++++++++++++-------- src/badguy/mrtree.hpp | 2 ++ 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/data/images/creatures/mr_tree/mr_tree.sprite b/data/images/creatures/mr_tree/mr_tree.sprite index e18e1e4cb..e6359bb9c 100644 --- a/data/images/creatures/mr_tree/mr_tree.sprite +++ b/data/images/creatures/mr_tree/mr_tree.sprite @@ -16,7 +16,8 @@ (mirror-action "large-left") ) (action - (y-offset 12) + (x-offset 20) + (y-offset 23) (name "small-left") (images "small-left-1.png" "small-left-2.png" @@ -28,17 +29,20 @@ ) ) (action - (y-offset 12) + (x-offset 20) + (y-offset 23) (name "small-right") (mirror-action "small-left") ) (action - (y-offset ) + (x-offset 20) + (y-offset 23) (name "squished-left") (images "squished-left.png") ) (action - (y-offset ) + (x-offset 20) + (y-offset 23) (name "squished-right") (mirror-action "squished-left") ) diff --git a/data/images/creatures/mr_tree/squished-left.png b/data/images/creatures/mr_tree/squished-left.png index 4d362a6548c7f6c7d81a19ab8da8b83808cc9300..44b59b3773ac793371ddfafe20b282b6a4629d92 100644 GIT binary patch literal 5609 zcmV}LP~03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@02NJ1L_t(|+U=ZKk7e1J zmY?riYwh6-F%OxQQ_TY&N_M-|hVHgOK>GqS3U09Ant#C$fd2sZ2)OD-Vvvx9jIrgi zv2m5lE@urn#gH+dY45$(`ncF9tIL)xfm~r{cE>9ng%ok(?AY&mzv*3T2VCI_SGd9z zu5g7bT;U2=xWW~#aD^*e;R;u{!WFJ?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h_*QPx3w~=7y~;TNPy1-{)}fGvc0jKp_&yrXln{=-ojx1*y?}i59bK{UDOYb zJUOXp{6`M(>!ua#i^$t4D=n^Lg)jTgyFVV_tFvP4TSBs1Alt^kspTb^h40hDNzc~k zaCxa`0)ijpj>EO3<*k~fnggTcO$`qpf4>3$WSP|JnX|amVf%aD>(;~eHz|z#>Ob%^ zYtuQqk_jmAKFha0LcTozoyc#XDrF=hvi~7ReouoDcLF=(0Y35k@XfTq-&@P+q0}dq z^ge49Q8qY5_!z85;wz_E+NDp81hSOx|C4tjxT8N#4sVo<FCjOb6QS9HO zqMzNIdST5` zT02Z+-xCT$zmDCVek+pBa30JPYiLlL6=QXBKL{gv&+~n-;I^*<#TeejIafk-C}ec| yq#a{(B6}`9EER5WF?i;V`M(fset_action(dir == LEFT ? "large-left" : "large-right"); - } else { + return; + } + if (mystate == STATE_NORMAL) { physic.set_velocity_x(dir == LEFT ? -WALKSPEED_SMALL : WALKSPEED_SMALL); - bbox.set_size(31.8, 31.8); sprite->set_action(dir == LEFT ? "small-left" : "small-right"); + return; } } @@ -66,8 +69,7 @@ MrTree::active_update(float elapsed_time) if (stay_on_platform && may_fall_off_platform()) { dir = (dir == LEFT ? RIGHT : LEFT); - sprite->set_action(dir == LEFT ? "large-left" : "large-right"); - physic.set_velocity_x(-physic.get_velocity_x()); + activate(); } BadGuy::active_update(elapsed_time); @@ -76,21 +78,37 @@ MrTree::active_update(float elapsed_time) bool MrTree::collision_squished(Player& player) { + // if we're big, we shrink if(mystate == STATE_BIG) { mystate = STATE_NORMAL; activate(); - + // shrink bounding box and adjust sprite position to where the stump once was + bbox.set_size(42, 62); + Vector pos = get_pos(); + pos.x += 20; + pos.y += 23; + set_pos(pos); + sound_manager->play("sounds/mr_tree.ogg", get_pos()); player.bounce(*this); - } else { -bbox.set_size(67.8, 99.8); -sprite->set_action(dir == LEFT ? "squished-left" : "squished-right"); -sound_manager->play("sounds/mr_treehit.ogg", get_pos()); -player.bounce(*this); - + + invincible_timer.start(INVINCIBLE_TIME); + + return true; } - + + // if we're small, but still invincible, we ignore the hit + if (!invincible_timer.check()) { + sound_manager->play("sounds/mr_treehit.ogg", get_pos()); + player.bounce(*this); + return true; + } + + // if we're small and no longer invincible, we die + sprite->set_action(dir == LEFT ? "squished-left" : "squished-right"); + bbox.set_size(42, 42); + kill_squished(player); return true; } diff --git a/src/badguy/mrtree.hpp b/src/badguy/mrtree.hpp index 93463f74f..fd2aebb5a 100644 --- a/src/badguy/mrtree.hpp +++ b/src/badguy/mrtree.hpp @@ -41,6 +41,8 @@ protected: MyState mystate; bool stay_on_platform; + Timer invincible_timer; + bool collision_squished(Player& player); }; -- 2.11.0