From 1ac057dac68afefe6e602f1d114becf8d7f535f2 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sat, 15 Apr 2006 16:34:34 +0000 Subject: [PATCH] Badguys "DartTrap" and "Dart" SVN-Revision: 3347 --- data/images/creatures/dart/dart.sprite | 14 +++ data/images/creatures/dart/flying.png | Bin 0 -> 359 bytes data/images/creatures/darttrap/darttrap.sprite | 25 +++++ data/images/creatures/darttrap/darttrap.xcf | Bin 0 -> 7888 bytes data/images/creatures/darttrap/idle.png | Bin 0 -> 1172 bytes data/images/creatures/darttrap/loading-0.png | Bin 0 -> 1196 bytes data/images/creatures/darttrap/loading-1.png | Bin 0 -> 1201 bytes data/images/creatures/darttrap/loading-2.png | Bin 0 -> 1207 bytes data/images/creatures/darttrap/loading-3.png | Bin 0 -> 1221 bytes data/images/creatures/darttrap/loading-4.png | Bin 0 -> 1237 bytes data/levels/test/darttrap.stl | 138 +++++++++++++++++++++++++ src/badguy/dart.cpp | 101 ++++++++++++++++++ src/badguy/dart.hpp | 50 +++++++++ src/badguy/darttrap.cpp | 108 +++++++++++++++++++ src/badguy/darttrap.hpp | 58 +++++++++++ 15 files changed, 494 insertions(+) create mode 100644 data/images/creatures/dart/dart.sprite create mode 100644 data/images/creatures/dart/flying.png create mode 100644 data/images/creatures/darttrap/darttrap.sprite create mode 100644 data/images/creatures/darttrap/darttrap.xcf create mode 100644 data/images/creatures/darttrap/idle.png create mode 100644 data/images/creatures/darttrap/loading-0.png create mode 100644 data/images/creatures/darttrap/loading-1.png create mode 100644 data/images/creatures/darttrap/loading-2.png create mode 100644 data/images/creatures/darttrap/loading-3.png create mode 100644 data/images/creatures/darttrap/loading-4.png create mode 100644 data/levels/test/darttrap.stl create mode 100644 src/badguy/dart.cpp create mode 100644 src/badguy/dart.hpp create mode 100644 src/badguy/darttrap.cpp create mode 100644 src/badguy/darttrap.hpp diff --git a/data/images/creatures/dart/dart.sprite b/data/images/creatures/dart/dart.sprite new file mode 100644 index 000000000..461a530a1 --- /dev/null +++ b/data/images/creatures/dart/dart.sprite @@ -0,0 +1,14 @@ +(supertux-sprite + (action + (name "flying-left") + (x-offset 3) + (y-offset 3) + (images "flying.png") + ) + (action + (name "flying-right") + (x-offset 3) + (y-offset 3) + (mirror-action "flying-left") + ) + ) diff --git a/data/images/creatures/dart/flying.png b/data/images/creatures/dart/flying.png new file mode 100644 index 0000000000000000000000000000000000000000..f817c77e73019960eb8004d4a88cf4dfeb6ac4b5 GIT binary patch literal 359 zcmeAS@N?(olHy`uVBq!ia0vp@K+Mj;1|%;R9G3!8Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj+Pl>0mEBiGTejaHPl@qG|Kq1)@*N775{M_8syb=cIqSVBa)D(sC z%#sX+kc?CXcTeAd_bIA*K!vA0T^vIsF3+7{=*JW&;(EUN41<)gvkK#5kJc?JQ-XIe zaS53*WfyQ>`qy+#H^O4}hWSSV7WyzGs(kprTtVP%$MSvZmODT2KUs5ih3Mm2b`9qD z`CZJYR6GMie>)W1S)O?+XXey5w_^47ht0of z^Ls;?Id6lcL0D+-q8FhqPiDN`n;tju$M34ke?PWXZ|9v|QC@w@_?Uu{;(>$KAGXMa xtJmGSee3Sx;%`h9*6%x>w@WWz(%5i=`TccA!Chxnb^*P`;OXk;vd$@?2>|}UicSCk literal 0 HcmV?d00001 diff --git a/data/images/creatures/darttrap/darttrap.sprite b/data/images/creatures/darttrap/darttrap.sprite new file mode 100644 index 000000000..129dca514 --- /dev/null +++ b/data/images/creatures/darttrap/darttrap.sprite @@ -0,0 +1,25 @@ +(supertux-sprite + (action + (name "idle-left") + (images "idle.png") + ) + (action + (name "idle-right") + (mirror-action "idle-left") + ) + (action + (name "loading-left") + (images + "idle.png" + "loading-0.png" + "loading-1.png" + "loading-2.png" + "loading-3.png" + "loading-4.png" + ) + ) + (action + (name "loading-right") + (mirror-action "loading-left") + ) + ) diff --git a/data/images/creatures/darttrap/darttrap.xcf b/data/images/creatures/darttrap/darttrap.xcf new file m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le.png b/data/images/creatures/darttrap/idle.png new file mode 100644 index 0000000000000000000000000000000000000000..69cbdaad5edd8421814b5a5ada336b7aa3fb2602 GIT binary patch literal 1172 zcmV;F1Z(?=P)9uxevWMKdR03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00a0*L_t(I%axQ*NLyJH z#((d|yc-jf7!9eKmQd0_B3;x!Fq?=~BNW`07FsB@Fi5vkTu%qwlrFj~%)YBGi@Fd& zu#^c!m-SCXp%t-ONfR6UlK1k?EYhY%VPNj+Eq?F2=bZ1m#{dj29y#;<`>k8I{_gJX zrtLo&(`SNAFUN4bI1g$mEXq4XG zUex)m{8|^ZonxrZNB{ zBO~(u{d=xny~?FamvCJdkH^FM`Z|_nwaodCTrNj{e?N&t0@F09)oN(1Nu^S}e*OAa zV>2@|GBh;A%E}7ma+$roJzl(cK{y;nDaFFVLZgiF@o~9v;|6nca~vKXvazwj+S(d} zgM(~rY)~u~Nu^Q^<>$|z%l!O2UauFW6#0CfVzJn)FQ3mhr$HnV!RPZ43lF1}WDg1svxm=DwAb@S#cmS?k zx$^YdwQHnODGm=0IX*saf&&8s92^{Anr1`!!-o%eJRU|zN4az74%KRvNF+jgdpnk8 z@#@tp`uqDE@Z#d45s$~kaUA@9KYe|DXss~}gSE9aZr;2}tycS$x%t+04ezf##2nj+mUBWPE&_ zrKKfOsT3n4BfNX}j#w<#`ckykT)%#uXf#SF6rx_Q)7RHWI28p%GTBv3kwT;`}U3P z?d_J;C8MLGlFeq>+}y-*94yO1DTUYTMMPTnb0(7^7K@QgCUG2x&dyFwPEMLGw!p6I zvcA4fJRV1D&GGRuB7$KUxUSm@E2R(-R##W?`Fv=t35Ubf>vih&dTY&q@%Zs$x2LBE m%d#jG3Y?yvVi*QWDgFiFMY@$ri=xE<00009w0+y1$O`d03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00a<8L_t(I%YBqjXj54f z#((c7c{fc=V%iYXMhOxFNpaEI#lVnKZBr0jj#N+(EJ*2cM!Fss-4qutg@G;$g1Zsz zLWF`M6Qo(%))oc-QTvCO)U+>oFYnAE8k;)IUA@KcefOO6efJoE!Ouqyec!xz@#0@S zJw15;2O^)(ODdHj91b%yG=%X@Sq|MG-@$A)OQBF891fGq<=V=|Vbu#4E=WF~XMB7d z5y7@?g25o(qgMl5zI>TBbLWmce*74p&xcZqVzEfMTyED_EEe0-AR3M0_xlNjLTqnu zv$wa`Vbc2gIwI17H#RoVTBEh5QmNp&ZU^i*4vyoXZr!>ie!m~T-;YuX%d&og-@kv~ zg1ufZxm*t0wyD?an5KzgbVgi6sMTtyxw$zb5D3s{G}<A8@T!vf{hC|zA$ zSeC`Y!UFyM{Vn*(lP5+pnH0xy2m}K3_4T2(#xM*@r4r}QpQq7i{779Yl_D4nva_>; zZQGQ~<#y^CjYexihaT%MlarJGbai!M+ct?rf>0>Lr%#_SO|zYi?*lDvZ*Ma`KF;Xq zC{Le0C6mc8JUq;c7cYp%Yt7lSXNkpPgu`K)%_e<)eMBM=g25mF;X}42uV23| zV`F0?B7Z)7_)sogx+H+UdiARO*Pd&i`T6Uywk$6%%e8CQWPg8OyoVR! z=g*&+ot?!rO}>2j!t2+sSzKJ?>({SrY;1I_E*Tjak$gVS+S(e9<6v19N-2CkA0pDZ zpL4k!@pzncI*sEv96x@Xy}iA*iyg4*x~#0MkW41gTC=;mi-=$t2CnON!b&MbgyrRB z{C+=LYa)>d&1REkv)NfQU`$U>yNN^s%d%KsUuS=RAHy(EO7SmPVZTFqt>%3I0000< KMNUMnLSTaNhcL$g literal 0 HcmV?d00001 diff --git a/data/images/creatures/darttrap/loading-1.png b/data/images/creatures/darttrap/loading-1.png new file mode 100644 index 0000000000000000000000000000000000000000..3b7d643008a96d28fcbd349938f9bce39ca43eba GIT binary patch literal 1201 zcmV;i1Wx;jP)9w*%akkkMG03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00b3D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4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00cQnL_t(I%YBqjXcJi+ z$3OGZOfyN+>aq6c1|Eg(cl;NkP0S3hT+@B3{?^z6USjq8CBv!J8+KOWT9U z7V3r#(&EWRn}u#$Y@4<_rZMRxGnu!CXxb?3JH5l_ec$)@R|7P@J?hZ?r;8UaPIY&8 z)A2tL>2zAfVljfjAR{9qXrGnUp&!&2Fquq}$z%uygQQZama=wO^}>Y*RU0p<@QM$XkDV0h{DG^`WNG6l4uC7w6)rdqQc)ebd$t3&x`z>Vv zMn^~0>({Rt8XBUfrw7+{@pwEeEiGYLR$HEb&SWwS4-XTI#qjxj)a!Mmlq3=fo_f6J?QG{!f~8tQ5uZ~uIr+d zqOY$H%d*(q+@w@0;W!R~K;QtbR4QD%c8yoBUQwx3h{xjyA@KYCWHK2H!@#y}JOIaz z9sBk8@#7>C35vxcySuwB@YJbOY;JDi^ZA;}Z{NPf7=~f6v$KP3 z+nA==>biQp-ptUUVf}7$a`Lav&Q5IGrnk43Kp?<}4i2VJ&Yk(Eu;TgqhYFW_GD9uD zPoF;ZK6&y)IgX>|=H}Fm8#k0~+iGE9L0!LoT~(`9)!Imtlauz=))x2f-6NaL^6}$G z-oJm(?CdO`K7FE4D739EH8wV;(&;qs-o3+d94yO12!Yq@MJd(3pHrz6(P)%-JdWcy z96frJa=F~9VjJwbE=x;G3=9k)rDS(^7o`-Mrs2A7J1m4iDaFFV0=ljvr6d#z(P%Vi zG#c%m0qyqf+iq`fFP3Goyu3`cT1C?|gb@4(lHAig>^&=L00000NkvXXu0mjf9_djA literal 0 HcmV?d00001 diff --git a/data/levels/test/darttrap.stl b/data/levels/test/darttrap.stl new file mode 100644 index 000000000..f189b89e8 --- /dev/null +++ b/data/levels/test/darttrap.stl @@ -0,0 +1,138 @@ +;; Generated by Flexlay Editor +(supertux-level + (version 2) + (name (_ "DartTrap Test")) + (author "Marek") + (sector + (name "main") + (gravity 10.000000) + (tilemap + (layer "background") + (solid #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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 + )) + (tilemap + (layer "foreground") + (solid #f) + (speed 1.000000) + (width 30) + (height 30) + (tiles + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + )) + (camera + (mode "normal") + ) + + (background + (image "images/background/arctis.jpg") + (speed 0.500000) + ) + + (darttrap (x 800) (y 850)) + (powerup (x 100) (y 700) (sprite "images/powerups/egg/egg.sprite")) + (spawnpoint (name "main") (x 40) (y 700)) + ) + ) + +;; EOF ;; diff --git a/src/badguy/dart.cpp b/src/badguy/dart.cpp new file mode 100644 index 000000000..99d5bb774 --- /dev/null +++ b/src/badguy/dart.cpp @@ -0,0 +1,101 @@ +// $Id: dart.cpp 3327 2006-04-13 15:02:40Z sommer $ +// +// Dart - Your average poison dart +// Copyright (C) 2006 Christoph Sommer +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. + +#include + +#include "dart.hpp" + +namespace { + const float SPEED = 200; +} + +Dart::Dart(const lisp::Lisp& reader) : set_direction(false), parent(0) +{ + reader.get("x", start_position.x); + reader.get("y", start_position.y); + bbox.set_size(9, 1); + sprite = sprite_manager->create("images/creatures/dart/dart.sprite"); + physic.enable_gravity(false); + countMe = false; +} + +Dart::Dart(float pos_x, float pos_y, Direction d, const BadGuy* parent = 0) : set_direction(true), initial_direction(d), parent(parent) +{ + start_position.x = pos_x; + start_position.y = pos_y; + bbox.set_size(9, 1); + sprite = sprite_manager->create("images/creatures/dart/dart.sprite"); + physic.enable_gravity(false); + countMe = false; +} + +void +Dart::write(lisp::Writer& writer) +{ + writer.start_list("dart"); + writer.write_float("x", start_position.x); + writer.write_float("y", start_position.y); + writer.end_list("dart"); +} + +void +Dart::activate() +{ + if (set_direction) dir = initial_direction; + physic.set_velocity_x(dir == LEFT ? -::SPEED : ::SPEED); + sprite->set_action(dir == LEFT ? "flying-left" : "flying-right"); +} + +void +Dart::deactivate() +{ + remove_me(); +} + +HitResponse +Dart::collision_solid(GameObject& , const CollisionHit& ) +{ + remove_me(); + return ABORT_MOVE; +} + +HitResponse +Dart::collision_badguy(BadGuy& badguy, const CollisionHit& ) +{ + // ignore collisions with parent + if (&badguy == parent) { + return FORCE_MOVE; + } + remove_me(); + badguy.kill_fall(); + return ABORT_MOVE; +} + +HitResponse +Dart::collision_player(Player& player, const CollisionHit& hit) +{ + remove_me(); + return BadGuy::collision_player(player, hit); +} + + + +IMPLEMENT_FACTORY(Dart, "dart") + diff --git a/src/badguy/dart.hpp b/src/badguy/dart.hpp new file mode 100644 index 000000000..36f858f9f --- /dev/null +++ b/src/badguy/dart.hpp @@ -0,0 +1,50 @@ +// $Id: dart.hpp 3327 2006-04-13 15:02:40Z sommer $ +// +// Dart - Your average poison dart +// Copyright (C) 2006 Christoph Sommer +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. + +#ifndef __DART_H__ +#define __DART_H__ + +#include "badguy.hpp" + +/** + * Badguy "Dart" - Your average poison dart + */ +class Dart : public BadGuy +{ +public: + Dart(const lisp::Lisp& reader); + Dart(float pos_x, float pos_y, Direction d, const BadGuy* parent); + + void activate(); + void deactivate(); + void write(lisp::Writer& writer); + + HitResponse collision_solid(GameObject& object, const CollisionHit& hit); + HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit); + HitResponse collision_player(Player& player, const CollisionHit& hit); + +protected: + bool set_direction; + Direction initial_direction; + const BadGuy* parent; /**< collisions with this BadGuy will be ignored */ +}; + +#endif + diff --git a/src/badguy/darttrap.cpp b/src/badguy/darttrap.cpp new file mode 100644 index 000000000..112837a22 --- /dev/null +++ b/src/badguy/darttrap.cpp @@ -0,0 +1,108 @@ +// $Id: darttrap.cpp 3342 2006-04-14 22:48:51Z sommer $ +// +// DartTrap - Shoots a Dart at regular intervals +// Copyright (C) 2006 Christoph Sommer +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include + +#include "darttrap.hpp" +#include "dart.hpp" + +namespace { + const float MUZZLE_Y = 28; /**< [px] muzzle y-offset from top */ +} + +DartTrap::DartTrap(const lisp::Lisp& reader) : initial_delay(0), fire_delay(2), ammo(-1), state(IDLE) +{ + reader.get("x", start_position.x); + reader.get("y", start_position.y); + reader.get("initial-delay", initial_delay); + reader.get("fire-delay", fire_delay); + reader.get("ammo", ammo); + bbox.set_size(11, 37); + sprite = sprite_manager->create("images/creatures/darttrap/darttrap.sprite"); + countMe = false; +} + +void +DartTrap::write(lisp::Writer& writer) +{ + writer.start_list("darttrap"); + writer.write_float("x", start_position.x); + writer.write_float("y", start_position.y); + writer.write_float("initial-delay", initial_delay); + writer.write_float("fire-delay", fire_delay); + writer.write_int("ammo", ammo); + writer.end_list("darttrap"); +} + +void +DartTrap::activate() +{ + if (set_direction) dir = initial_direction; + state = IDLE; + sprite->set_action(dir == LEFT ? "idle-left" : "idle-right"); + + if (initial_delay == 0) initial_delay = 0.1; + fire_timer.start(initial_delay); +} + +HitResponse +DartTrap::collision_player(Player& , const CollisionHit& ) +{ + return ABORT_MOVE; +} + +void +DartTrap::active_update(float ) +{ + if (state == IDLE) { + if ((ammo != 0) && (fire_timer.check())) { + if (ammo > 0) ammo--; + load(); + fire_timer.start(fire_delay); + } + } + if (state == LOADING) { + if (sprite->animation_done()) { + fire(); + } + } +} + +void +DartTrap::load() +{ + state = LOADING; + sprite->set_action(dir == LEFT ? "loading-left" : "loading-right", 1); +} + +void +DartTrap::fire() +{ + float px = get_pos().x; + if (dir == RIGHT) px += 5; + float py = get_pos().y; + py += MUZZLE_Y; + + Sector::current()->add_object(new Dart(px, py, dir, this)); + state = IDLE; + sprite->set_action(dir == LEFT ? "idle-left" : "idle-right"); +} + +IMPLEMENT_FACTORY(DartTrap, "darttrap") + diff --git a/src/badguy/darttrap.hpp b/src/badguy/darttrap.hpp new file mode 100644 index 000000000..dce5778be --- /dev/null +++ b/src/badguy/darttrap.hpp @@ -0,0 +1,58 @@ +// $Id: darttrap.hpp 3327 2006-04-13 15:02:40Z sommer $ +// +// DartTrap - Shoots a Dart at regular intervals +// Copyright (C) 2006 Christoph Sommer +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#ifndef __DARTTRAP_H__ +#define __DARTTRAP_H__ + +#include "badguy.hpp" +#include "timer.hpp" + +/** + * Badguy "DartTrap" - Shoots a Dart at regular intervals + */ +class DartTrap : public BadGuy +{ +public: + DartTrap(const lisp::Lisp& reader); + + void activate(); + void write(lisp::Writer& writer); + void active_update(float elapsed_time); + HitResponse collision_player(Player& player, const CollisionHit& hit); + +protected: + enum State { + IDLE, LOADING + }; + + void load(); /**< load a shot */ + void fire(); /**< fire a shot */ + + bool set_direction; + Direction initial_direction; + float initial_delay; /**< time to wait before firing first shot */ + float fire_delay; /**< reload time */ + int ammo; /**< ammo left (-1 means unlimited) */ + + State state; /**< current state */ + Timer fire_timer; /**< time until new shot is fired */ +}; + +#endif + -- 2.11.0