From 157cef71aeb9ae25b7bb90f37dda11bc09329d11 Mon Sep 17 00:00:00 2001 From: Ryan Flegel Date: Tue, 25 May 2004 02:51:30 +0000 Subject: [PATCH] - beginnings of a wingling SVN-Revision: 1321 --- data/images/shared/wingling-1.png | Bin 0 -> 5020 bytes data/supertux.strf | 16 ++++++++---- src/badguy.cpp | 53 +++++++++++++++++++++++++++++++++++++- src/badguy.h | 2 ++ 4 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 data/images/shared/wingling-1.png diff --git a/data/images/shared/wingling-1.png b/data/images/shared/wingling-1.png new file mode 100644 index 0000000000000000000000000000000000000000..1b065527e4eae2787a1f50b7d7ea8d781462c645 GIT binary patch literal 5020 zcmV;N6JzX&P)hu~`trIY|j2f&^6hyaiQ_yEKRA^+;BeZx7Sl#-g78h*{1H9{;F z``Z64XS>xUvv1$NQSZL{?oWB1H|6ByJPE*ix!-X)VMfx3QhH`Bepx$y>(;Fgvn>1Q z;NW0YOG}G%=~KKkD5VUg^b4PlNB{s#TU%RMPfyR-^9iwg_wI?Eot=00_xEG=?Abf- zxZ{rK1x%D(x^!vA!Gi~dk@guO>iHgyNC1b!VW_F8d0L~hNx{Py0$;um}YUn&5llt_}aL^SCQ+iJH$rOJ%P#>SsfO7)adMpab|4%zZP z*;4aHUS3}2ym|9rGMP3JLXk7EuTe^QpU?Nbg$oy2N=r*`Ip2IFNisDy zHvZ;?7hc#@Q&UrPv4)>vBp$%Fw6x?WXP7X3ZW%f{+n6EO(0?30((+6o5GZlF95Xj; z*zm`?`np-qJ--54tv2TO`|Hklh}-SvckbL-uw%!LXKgmyq;tK%;c(0n1fh!KSa2M7 zZ6p%OIaj-umKN(9Z@ls9Lk~Ul=<(ynxjA#@#4g_S(~KkxvR&O>oFz{W%E_2L|J$fp zztzmJ_-P;*n6bBEZ)Qhld;a|o{SZ?tE3tmv2Cr7Dwa26=w`I$gQBOVf)Ps7x{`Q=l z9N*B;Q1zlki~ect1S5X(-n)OUl4MC+v*i=y<>e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rMJikySNeg{;ALQz#H2^j{H5z%lIVv35<4$XP}{} z!@mBbZ8x^I9&4tQG62-eT?%u-qftuvC!Tm>bKj{`b1O@y;Bea!7>y?6WsSyX#}1)# zY9%~g50X<-;2d1oSvn1q z$4Am|QXmt6q5xDZ~V4hYdzq3qewl2zy}AE6B((V02+RR7x=%9ELk? zhdtVgNW=rL+YX*Yn3N=O`d4B2-|V@VPPN;1bG5r`pE!Ex@bh4dI~`G%y*= zP$U_#Pz3Qv42r726NzFt7D6l(gU9PpY##eyr{kp86Y(9<2>MNFV$N`vr)?aoh0X1Y zE{@BX5sJub7)ZI9R>RERq3B&7eDJ|RoGy#ItXy=F)bG~(-Zy1R#lp6>wke(Vo+$#u z-(b{get_tux(); + + if (fabsf(tux.base.x - base.x) < 200 && base.y < tux.base.y && tux.dying == DYING_NOT) + physic.set_velocity(-2.0f, -2.0f); + else + physic.set_velocity(-WINGLING_FLY_SPEED, 0); + } + + physic.apply(elapsed_time, base.x, base.y); + + + // Handle dying timer: + if (dying == DYING_SQUISHED && !timer.check()) + remove_me(); +} + + +void BadGuy::action(float elapsed_time) { float scroll_x = World::current()->camera->get_translation().x; @@ -864,6 +899,11 @@ BadGuy::action(float elapsed_time) case BAD_SNOWBALL: action_snowball(elapsed_time); break; + + case BAD_WINGLING: + action_wingling(elapsed_time); + break; + default: break; } @@ -1040,7 +1080,12 @@ BadGuy::squish(Player* player) squish_me(player); set_sprite(img_snowball_squished_left, img_snowball_squished_right); return; + } else if(kind == BAD_WINGLING) { + squish_me(player); + set_sprite(img_wingling_left, img_wingling_left); } + + } void @@ -1123,6 +1168,7 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type) case CO_BADGUY: pbad_c = (BadGuy*) p_c_object; + /* If we're a kicked mriceblock, kill [almost] any badguys we hit */ if(kind == BAD_MRICEBLOCK && mode == KICK && kind != BAD_FLAME && kind != BAD_BOMB && kind != BAD_STALACTITE) @@ -1168,7 +1214,11 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type) /* When enemies run into eachother, make them change directions */ else { - // Jumpy, fish, flame, stalactites are exceptions + // Wingling doesn't interact with other badguys + if (pbad_c->kind == BAD_WINGLING || kind == BAD_WINGLING) + break; + + // Jumpy, fish, flame, stalactites, wingling are exceptions if (pbad_c->kind == BAD_JUMPY || pbad_c->kind == BAD_FLAME || pbad_c->kind == BAD_STALACTITE || pbad_c->kind == BAD_FISH) break; @@ -1283,6 +1333,7 @@ void load_badguy_gfx() img_snowball_right = sprite_manager->load("snowball-right"); img_snowball_squished_left = sprite_manager->load("snowball-squished-left"); img_snowball_squished_right = sprite_manager->load("snowball-squished-right"); + img_wingling_left = sprite_manager->load("wingling-left"); } void free_badguy_gfx() diff --git a/src/badguy.h b/src/badguy.h index b4c3f527f..cc3c70ab6 100644 --- a/src/badguy.h +++ b/src/badguy.h @@ -49,6 +49,7 @@ enum BadGuyKind { BAD_FLYINGSNOWBALL, BAD_SPIKY, BAD_SNOWBALL, + BAD_WINGLING, NUM_BadGuyKinds }; @@ -144,6 +145,7 @@ private: void action_flyingsnowball(double frame_ratio); void action_spiky(double frame_ratio); void action_snowball(double frame_ratio); + void action_wingling(double frame_ratio); /** initializes the badguy (when he appears on screen) */ void activate(Direction direction); -- 2.11.0