From 94e118e3ec45c6decf402acef25314069e3f18b9 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Thu, 25 May 2006 14:52:51 +0000 Subject: [PATCH] Platform now scriptable SVN-Revision: 3583 --- data/images/objects/platforms/vertical-wood.png | Bin 0 -> 4680 bytes data/images/objects/platforms/vertical-wood.sprite | 6 + data/levels/test/platform.stl | 318 ++++++++++----------- src/object/path_walker.cpp | 10 +- src/object/path_walker.hpp | 9 +- src/object/platform.cpp | 15 +- src/object/platform.hpp | 2 + 7 files changed, 183 insertions(+), 177 deletions(-) create mode 100644 data/images/objects/platforms/vertical-wood.png create mode 100644 data/images/objects/platforms/vertical-wood.sprite diff --git a/data/images/objects/platforms/vertical-wood.png b/data/images/objects/platforms/vertical-wood.png new file mode 100644 index 0000000000000000000000000000000000000000..653cf4331c29a440bc9901a6bdf26b56c1d30ef5 GIT binary patch literal 4680 zcmV-O61VM%P)WFU8GbZ8({Xk{QrNlj4iWF>9@01>Q7L_t(|+U;9Sk7QR; zJrVcb_cF6Sy4>yV_O#86X9k2cGeU?F;$s0w2xQMDHReeZ=I{+4oE}a-~Xa)>b zu)eA=GtG%AF^MtJn#0Lw*&C~&Y~5EF($aJk;$U|I0f(+xiU zUuX8ifBtB_tNN#A_>(q(-vRK>!`F`=|H?1EdGhGN!RpRo#>r6z6M=|81PoP?6XWMwo$-fMUIa=6MkTqPW>GKc{tAZMT?!lENAItBp%S;WvUq-GE`R8iClB&Km~ zIo^{K;f>c<_~q~1U;NeI{m0MbM9=fGFW-9j`tbn(NHv%lL=2bf3WLE6K0`GmCMmbGY|->f{UvGT_zkXGZuY9VxT6VFNCkXd4#V$I>K(yKgd<}n@5L> zb5R^^2E()SilG{a3`{=iDjwdhFfKR1*(IYZG`_xCCJ-4^0hs?Z7}f?{Z3V{%9dJY_ zg`w(^`OeSX#Sj1G?pytbvBJA6p;wo449iuM{UHHTv+*{%7Vv7vmLEq&MeO!jUe*}mcL_7&4Mz0ER z@=*63gPCx(RnM0M?5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ViuO&JAC-0s{Cey-^3vf^@G@!vna z#Q!{5qm=Xyi4*0`w*KCBH{j%WfxgQ~%(Jc+Xg2CUOh>w}S#)!vWYISo!(w*N_>-q= z{N+3EUjg{>c91`eUHbHnnf*2Z%9*z($4ivNC1o}klGAHJN{lxj9%0dEbS3-YXl5KA zF5(7-pTH<_=5(_ikaEI$J>dLugC|ed^~1+!x>|OB{%ha;#vgtE2k-3&0KWHI-{K$r zMq)kzKq8jo z21d8riQkXO3<5Ser%x7r{-E!=e|+P?@!uY-`ggzogZG{R!2beSKxI2Xd%gw$0000< KMNUMnLSTZClC5?C literal 0 HcmV?d00001 diff --git a/data/images/objects/platforms/vertical-wood.sprite b/data/images/objects/platforms/vertical-wood.sprite new file mode 100644 index 000000000..de14a8999 --- /dev/null +++ b/data/images/objects/platforms/vertical-wood.sprite @@ -0,0 +1,6 @@ +(supertux-sprite + (action + (name "default") + (images "vertical-wood.png") + ) +) diff --git a/data/levels/test/platform.stl b/data/levels/test/platform.stl index 247a12642..d4edad340 100644 --- a/data/levels/test/platform.stl +++ b/data/levels/test/platform.stl @@ -1,186 +1,170 @@ -;; Generated by Flexlay Editor (supertux-level (version 2) - (name (_ "Flying Platform Test")) + (name (_ "Flying Platform Test")) (author "Marek") (sector - (name "main") - (gravity 10.000000) + (name "main") + (background + (x 0) + (y 0) + (image "images/background/arctis.jpg") + (speed 0.5) + ) (tilemap (z-pos -100) (solid #f) - (speed 1.000000) - (width 30) + (speed 1) + (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 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 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1620 1621 0 1624 1625 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1622 1623 0 1626 1627 1349 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + ) (tilemap (z-pos 0) (solid #t) - (speed 1.000000) - (width 30) + (speed 1) + (width 30) (height 30) - (tiles - 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 0 0 0 0 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 0 0 0 0 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 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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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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) - ) - - (platform - (path - (mode "pingpong") - (node (x 200) (y 850)) - (node (x 200) (y 750) (time 0.5)) - (node (x 100) (y 750)) - ) - (sprite "images/objects/platforms/small.sprite") - ) - (platform - (path - (mode "pingpong") - (node (x 264) (y 850) (time 1)) - (node (x 264) (y 850) (time 1)) - (node (x 264) (y 750) (time 1)) - (node (x 264) (y 750) (time 1)) - ) - (sprite "images/objects/platforms/small.sprite") - ) - (platform - (path - (mode "circular") - (node (x 328) (y 850) (time 1)) - (node (x 328) (y 850) (time 1)) - (node (x 328) (y 750) (time 2)) - ) - (sprite "images/objects/platforms/small.sprite") - ) - (platform - (path - (mode "circular") - (node (x 392) (y 850) (time 1)) - (node (x 392) (y 750) (time 1)) - (node (x 392) (y 650) (time 0.6)) - (node (x 392) (y 750) (time 1)) - ) - (sprite "images/objects/platforms/small.sprite") - ) - (platform - (path - (mode "circular") - (node (x 456) (y 750)) - (node (x 100) (y 300)) - (node (x 456) (y 300)) - (node (x 456) (y 750)) - ) - (sprite "images/objects/platforms/small.sprite") - ) - (powerup (x 100) (y 700) (sprite "images/powerups/egg/egg.sprite")) - (jumpy (x 140) (y 750)) - (spawnpoint (name "main") (x 340) (y 800)) - ) - ) - -;; EOF ;; + (jumpy + (x 140) + (y 750) + ) + (spawnpoint + (name "main") + (x 340) + (y 800) + ) + (platform + (sprite "images/objects/platforms/small.sprite") + (path + (mode "pingpong") + (node + (x 200) + (y 850) + ) + (node + (x 200) + (y 750) + (time 0.5) + ) + (node + (x 100) + (y 750) + ) + ) + ) + (platform + (sprite "images/objects/platforms/small.sprite") + (path + (mode "pingpong") + (node + (x 264) + (y 850) + ) + (node + (x 264) + (y 850) + ) + (node + (x 264) + (y 750) + ) + (node + (x 264) + (y 750) + ) + ) + ) + (platform + (sprite "images/objects/platforms/small.sprite") + (path + (mode "circular") + (node + (x 328) + (y 850) + ) + (node + (x 328) + (y 850) + ) + (node + (x 328) + (y 750) + (time 2) + ) + ) + ) + (platform + (sprite "images/objects/platforms/small.sprite") + (path + (mode "circular") + (node + (x 392) + (y 850) + ) + (node + (x 392) + (y 750) + ) + (node + (x 392) + (y 650) + (time 0.6) + ) + (node + (x 392) + (y 750) + ) + ) + ) + (platform + (name "platform1") + (running #f) + (sprite "images/objects/platforms/vertical-wood.sprite") + (path + (mode "circular") + (node + (x 832) + (y 800) + ) + (node + (x 832) + (y 704) + ) + ) + ) + (powerup + (x 100) + (y 700) + (sprite "images/powerups/egg/egg.sprite") + ) + (scripttrigger + (script "platform1.goto_node(1);") + (button #f) + (width 32) + (height 32) + (x 689) + (y 875) + ) + (scripttrigger + (script "platform1.goto_node(0);") + (button #f) + (width 32) + (height 32) + (x 785) + (y 875) + ) + ) +) diff --git a/src/object/path_walker.cpp b/src/object/path_walker.cpp index abb42bc1e..a44b157f3 100644 --- a/src/object/path_walker.cpp +++ b/src/object/path_walker.cpp @@ -23,8 +23,8 @@ #include #include "path_walker.hpp" -PathWalker::PathWalker(const Path* path) - : path(path), current_node_nr(0), next_node_nr(0), stop_at_node_nr(-1), node_time(0), +PathWalker::PathWalker(const Path* path, bool running) + : path(path), running(running), current_node_nr(0), next_node_nr(0), stop_at_node_nr(-1), node_time(0), walking_speed(1.0) { last_pos = path->nodes[0].position; @@ -39,7 +39,7 @@ PathWalker::~PathWalker() Vector PathWalker::advance(float elapsed_time) { - if (static_cast(current_node_nr) == stop_at_node_nr) return Vector(0,0); + if (!running) return Vector(0,0); assert(elapsed_time >= 0); @@ -79,12 +79,15 @@ PathWalker::advance(float elapsed_time) void PathWalker::goto_node(int node_no) { + if (node_no == stop_at_node_nr) return; + running = true; stop_at_node_nr = node_no; } void PathWalker::start_moving() { + running = true; stop_at_node_nr = -1; } @@ -99,6 +102,7 @@ void PathWalker::advance_node() { current_node_nr = next_node_nr; + if (static_cast(current_node_nr) == stop_at_node_nr) running = false; if(next_node_nr + 1 < path->nodes.size()) { next_node_nr++; diff --git a/src/object/path_walker.hpp b/src/object/path_walker.hpp index 3766497f2..0b8357fe8 100644 --- a/src/object/path_walker.hpp +++ b/src/object/path_walker.hpp @@ -32,7 +32,7 @@ class PathWalker { public: - PathWalker(const Path* path); + PathWalker(const Path* path, bool running = true); virtual ~PathWalker(); /** @@ -55,7 +55,12 @@ public: private: void advance_node(); void goback_node(); - + + /** + * set to false to immediately stop advancing + */ + bool running; + size_t current_node_nr; size_t next_node_nr; diff --git a/src/object/platform.cpp b/src/object/platform.cpp index fa9e3153b..d6dde0a7c 100644 --- a/src/object/platform.cpp +++ b/src/object/platform.cpp @@ -35,21 +35,24 @@ #include "scripting/squirrel_util.hpp" Platform::Platform(const lisp::Lisp& reader) - : MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), speed(Vector(0,0)) + : MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), name(""), speed(Vector(0,0)) { + bool running = true; + reader.get("name", name); + reader.get("running", running); const lisp::Lisp* pathLisp = reader.get_lisp("path"); if(pathLisp == NULL) throw std::runtime_error("No path specified for platform"); path.reset(new Path()); path->read(*pathLisp); - walker.reset(new PathWalker(path.get())); + walker.reset(new PathWalker(path.get(), running)); bbox.set_pos(path->get_base()); flags |= FLAG_SOLID; } Platform::Platform(const Platform& other) - : MovingSprite(other), ScriptInterface(other), speed(other.speed) + : MovingSprite(other), ScriptInterface(other), name(other.name), speed(other.speed) { path.reset(new Path(*other.path)); walker.reset(new PathWalker(*other.walker)); @@ -105,14 +108,16 @@ Platform::stop_moving() void Platform::expose(HSQUIRRELVM vm, SQInteger table_idx) { + if (name == "") return; Scripting::Platform* interface = new Scripting::Platform(this); - expose_object(vm, table_idx, interface, "Platform", true); + expose_object(vm, table_idx, interface, name, true); } void Platform::unexpose(HSQUIRRELVM vm, SQInteger table_idx) { - Scripting::unexpose_object(vm, table_idx, "Platform"); + if (name == "") return; + Scripting::unexpose_object(vm, table_idx, name); } IMPLEMENT_FACTORY(Platform, "platform"); diff --git a/src/object/platform.hpp b/src/object/platform.hpp index 3f1785b8e..c38f24ace 100644 --- a/src/object/platform.hpp +++ b/src/object/platform.hpp @@ -21,6 +21,7 @@ #define __PLATFORM_H__ #include +#include #include "object/moving_sprite.hpp" #include "object/path.hpp" #include "object/path_walker.hpp" @@ -56,6 +57,7 @@ public: virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx); private: + std::string name; /**< user-defined name for use in scripts or empty string if not scriptable */ std::auto_ptr path; std::auto_ptr walker; Vector speed; -- 2.11.0