From e6a77f812ba40e831e9c1048f8c39a9be50eda37 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 3 Jul 2006 23:50:33 +0000 Subject: [PATCH] Made invincibility sparkle a particle effect SVN-Revision: 3864 --- data/images/objects/particles/sparkle-0.png | Bin 0 -> 432 bytes data/images/objects/particles/sparkle-1.png | Bin 0 -> 520 bytes data/images/objects/particles/sparkle.sprite | 20 +++++++++++++++++++ src/object/player.cpp | 28 ++++++++++++++++----------- 4 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 data/images/objects/particles/sparkle-0.png create mode 100644 data/images/objects/particles/sparkle-1.png create mode 100644 data/images/objects/particles/sparkle.sprite diff --git a/data/images/objects/particles/sparkle-0.png b/data/images/objects/particles/sparkle-0.png new file mode 100644 index 0000000000000000000000000000000000000000..d4bfed475a17ba12b2f1b215c3f4ad08012aa4e7 GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYYs>cdx@v7EBiHeW^pdP>1AbifI_k*t`Q~9`MJ5Nc_j?aMX8A;sVNHO znI#ztAsML(?w-B@?^9Is7#J8uJY5_^JdVG;V(ZQ9C~)lK{iDW1P8^_}`UOpE5Ucu%1nbGU! z`v(H)7M;cX=BlQyUMp7wO}w6B&m{9uMm%F-ckZ4?lKK)MD^Fx+O+LPNdqGdI%mU#F zuY+Q>vTy!)X}Kb3g4f+kM|IaF*;|!A{%!E*Ig?1?dfP39lI3xFMb_V%Kg^e%ka{!S zE0bkMw~n>&tu5Qn$cPyFaLQM#kl6Al-%d1nLCv9L^Etbh26>%zjViqOKkS?JH{R|Q WC6`!cR{H}3lEKr}&t;ucLK6Tgw5tUG literal 0 HcmV?d00001 diff --git a/data/images/objects/particles/sparkle-1.png b/data/images/objects/particles/sparkle-1.png new file mode 100644 index 0000000000000000000000000000000000000000..d6e3b334275d3d296442fc081e20b4c02e6de0ff GIT binary patch literal 520 zcmV+j0{8uiP)WFU8GbZ8({Xk{QrNlj4iWF>9@00C@CL_t(Y$L*9cOG053 zhM!ZZs1;6$e<1&WP(w7d-ZdN=qbX=>kM^2`enL}I;F@zkp{AgraJpz-P|>&L1Y&xx zN=1VQE{E@Y-#IVuIqyBNw0~!kc78H%Wy<5@v2#XJcI3;%y^jSjvqw*=NlHt~136$5 zD7eo_%KLq7H1Auz7|J)m7I5Z8H-Hq-2iiajr~yqgJDpZ14j>QQ0^7hjP;w>_@CIA~ z&%lwHb>;?ekTOtr26b;y2n5a`0GdE#X5B@UQIT{aDU{Te^zJ_NctuiCQg-Gck6Fsw z(g0S0qWgx&Q%N<}5&-(%^AH$#O9y_A{C*f$Ac;ZS2O0of;NE@U@ix$l14$Zk33ve3 zfy)sUT>u}z0nl1VMUv7k(=u>4;Xk+oo?NEAnOiiXh-;_5>r#9LUfef5KJ<6<&ERXd zm|4~7N3Q$OePm`GGpi=;qDjT~=SpyZnYOT`f~38_T=Pr&eftFHxyg1Q84?x%0000< KMNUMnLSTZ|pVG TUX_INVINCIBLE_TIME_WARNING + || size_t(game_time*20)%2) + && !dying) + { + if (systemRandom.rand(0, 2) == 0) { + float px = systemRandom.randf(bbox.p1.x+0, bbox.p2.x-0); + float py = systemRandom.randf(bbox.p1.y+0, bbox.p2.y-0); + Vector ppos = Vector(px, py); + Vector pspeed = Vector(0, 0); + Vector paccel = Vector(0, 0); + Sector::current()->add_object(new SpriteParticle("images/objects/particles/sparkle.sprite", "small", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS+1+5)); + } + } + } bool @@ -858,17 +875,6 @@ Player::draw(DrawingContext& context) else tux_body->draw(context, get_pos(), layer); - // Draw blinking star overlay - if (invincible_timer.started() && - (invincible_timer.get_timeleft() > TUX_INVINCIBLE_TIME_WARNING - || size_t(game_time*20)%2) - && !dying) - { - if (!is_big() || duck) - smalltux_star->draw(context, get_pos(), layer + 5); - else - bigtux_star->draw(context, get_pos(), layer + 5); - } } void -- 2.11.0