vdv_cx Posted February 9, 2014 Share Posted February 9, 2014 Hey There, i would like to create a ropegun like in Worms. The Person is moving and can shoot out a rope that sticks to the player and flys to the pointers position. I tried it with "line" but didn't worked.. Could anyone give me an advice? Link to comment Share on other sites More sharing options...
jpdev Posted February 9, 2014 Share Posted February 9, 2014 Hi, I have played around a little and I have come up with this: http://janpeter.net/perma/phaser/rope.html Click anywhere to shoot the gun, use right click + "view source" to check out the code. The idea: The rope is a sprite, which is rotated and scaled to span between the gun and the target. clark and Mike 2 Link to comment Share on other sites More sharing options...
vdv_cx Posted February 9, 2014 Author Share Posted February 9, 2014 Love your Coding Style! Could learn alot from you! Thank you jpdev 1 Link to comment Share on other sites More sharing options...
vdv_cx Posted February 11, 2014 Author Share Posted February 11, 2014 mh i think it doesn't fit my needs.. the rope needs collision detection and should "fold" when it is touched by other objects, for a more realistic "swing" and it needs gravity.. Link to comment Share on other sites More sharing options...
vdv_cx Posted February 11, 2014 Author Share Posted February 11, 2014 Solved with : game.physics.moveToObject(displayObject, destination, speed, maxTime) Link to comment Share on other sites More sharing options...
Recommended Posts