[Behavior] SplinePath Forum Home > Construct 2 Development > Plugins for Construct 2 |
Post Reply
|
Page 123> |
| Author | |
Post Options
Quote Reply
Topic: [Behavior] SplinePathPosted: 07 Mar 2012 at 6:08pm |
|
|
It's a behavior which was getting dusty on my hard drive, so I cleaned it a bit, and I'm posting it here.
The idea is to set Spline Path for Sprite, making them moves along a spline with a smooth path. ![]() The spline code is adapted from here : https://github.com/MmmCurry/jquery.crSpline. Instead of setting the (X,Y) position via CSS and jQuery.fx, I'm directly accessing the (X,Y) position of the Sprite. The spline used is Catmull-Rom, allowing the trajectory to go through the points, instead of Bezier, where the control points and the trajectory points are different. The demo : http://dl.dropbox.com/u/1412774/SplinePathBehavior/index.html The capx : http://dl.dropbox.com/u/1412774/SplinePathBehavior/splinepathbehaviordemo.capx The plugin : http://dl.dropbox.com/u/1412774/SplinePathBehavior/pode_splinepath.0.1.zip Edit : the demo uses R0j0hound's Canvas, for the trail. Edited by Pode - 07 Mar 2012 at 6:11pm |
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 6:48pm |
|
|
Thanks again!
Any plans for stuff like speed, and resetting points? |
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 6:56pm |
|
|
@newt : yes, I'm planning to add speed (allowing you to choose how much time between two points), and resetting the behavior.
|
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 7:52pm |
|
|
Thanks i haven't had time to use this yet due to redoing my PC, but is there a At End of Path feature, say Reverse, or Jump to Beggining...?
If not this would be great for Patroling Enemies. Edited by tonycrew - 07 Mar 2012 at 7:54pm |
|
|
http://dl.dropbox.com/u/44766364/Games/Space2011/index.html Space 2011 (C2 Competition Entry
http://dl.dropbox.com/u/44766364/Games/getin/index.html Get That Ball In (C2 Game) |
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 8:10pm |
|
|
@tonycrew : for the moment, you need to do that manually, by adding points for the "go-back" path, but thanks for the suggestion, I'm going to add it.
|
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 8:12pm |
|
|
Thanks that will be great and save alot of time....
|
|
|
http://dl.dropbox.com/u/44766364/Games/Space2011/index.html Space 2011 (C2 Competition Entry
http://dl.dropbox.com/u/44766364/Games/getin/index.html Get That Ball In (C2 Game) |
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 8:39pm |
|
|
very useful...tnx a lot Pode
|
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 10:33pm |
|
|
Haha awesome, I was about halfway through creating my own path system! Now I can focus on the actual game creation. Thanks!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 10:49pm |
|
|
BOSSY plugin for tower defense games.
Thanks Pode! |
|
![]() |
|
Post Options
Quote Reply
Posted: 07 Mar 2012 at 11:53pm |
|
|
Cool~ Can I use the algorithm of spline path in my step behavior?
Edited by rexrainbow - 07 Mar 2012 at 11:54pm |
|
![]() |
|
Post Reply
|
Page 123> |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |