Is there a way to give a sprite a trail?

Forum Home Forum Home > Construct 2 General > How do I....?
 Post Reply Post Reply Page  12>
Author
2,101 Rep
Post Options Post Options   Quote DoubleElite Quote  Post ReplyReply Direct Link To This Post Topic: Is there a way to give a sprite a trail?
    Posted: 14 Dec 2011 at 11:48pm
Is there a way to do this? I'm about to head out so I can't look it up. Could someone answer this for me?
Thanks for your time!
Back to Top
6,115 Rep
Post Options Post Options   Quote Era Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 1:53am
I'm also looking for something similar, if i understood you correctly. Like, the player object constantly creates new objects, which fades within x seconds?
Back to Top
2,101 Rep
Post Options Post Options   Quote DoubleElite Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 2:14am
Yes, that's exactly what I'm looking for. I'll let you know if I find a way.
Back to Top
6,115 Rep
Post Options Post Options   Quote Era Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 2:22am
I dont have the time to experiment, but try fooling around with emitting the same object from a desired angle, from the player, then fading it.

I assume you could start with making a single object, create the desired behaviour (movement, scaling, fadeout), then for example make the player object create that object every tick while moving or something.

Im just thinking loudly here :)
Back to Top
4,219 Rep
Post Options Post Options   Quote Ize Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 7:01am
EDIT:
removed lame pseudocode and added example:

http://dl.dropbox.com/u/45711709/trail.capx


done :D

this ofcourse spawns MANY sprites... so you might need to adjust the values to make it look good / don't kill the performance

Edited by Ize - 15 Dec 2011 at 7:09am
Back to Top
1,732 Rep
Post Options Post Options   Quote zurtri Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 8:20am
Just make a event that for every x seconds create a the trail sprite.

Set the trail to head of in a direction and fade after x seconds.

I do this to simulate smoke.
Back to Top
11,785 Rep
Post Options Post Options   Quote Yann Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 12:07pm
easy peasy
http://dl.dropbox.com/u/23551572/C2/trail.capx

need Canvas Plugin
(will be a lot faster once Canvas will be webGL compatible)

Edited by Yann - 15 Dec 2011 at 12:07pm
Back to Top
4,219 Rep
Post Options Post Options   Quote Ize Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 12:31pm
Nice @Yann :D

I wish we could use canvas for uploads to the arcade... same with spritefont :/
Back to Top
11,785 Rep
Post Options Post Options   Quote Yann Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 10:54pm
http://dl.dropbox.com/u/23551572/C2/trailNoCanvas.capx
Probably same idea as Ize. And I suspect it's even better than the Canvas solution fps wise.
Back to Top
1,344 Rep
Post Options Post Options   Quote Antylope Quote  Post ReplyReply Direct Link To This Post Posted: 25 May 2012 at 5:08pm
Thanks for the example Yann, it works great!
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down