Is there a way to give a sprite a trail?

Get help using Construct 2

Post » Wed Dec 14, 2011 11:48 pm

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!
B
16
S
3
G
5
Posts: 43
Reputation: 3,880

Post » Thu Dec 15, 2011 1:53 am

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?
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Thu Dec 15, 2011 2:14 am

Yes, that's exactly what I'm looking for. I'll let you know if I find a way.
B
16
S
3
G
5
Posts: 43
Reputation: 3,880

Post » Thu Dec 15, 2011 2:22 am

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 :)
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Thu Dec 15, 2011 7:01 am

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 performanceIze2011-12-15 07:09:45
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Thu Dec 15, 2011 8:20 am

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.
B
21
S
5
G
2
Posts: 26
Reputation: 2,512

Post » Thu Dec 15, 2011 12:07 pm

easy peasy
trail.capx

need Canvas Plugin
(will be a lot faster once Canvas will be webGL compatible)Yann2011-12-15 12:07:21
Last edited by Yann on Sun Sep 14, 2014 10:38 am, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Dec 15, 2011 12:31 pm

Nice @Yann :D

I wish we could use canvas for uploads to the arcade... same with spritefont :/
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Thu Dec 15, 2011 10:54 pm

trailNoCanvas.capx
Probably same idea as Ize. And I suspect it's even better than the Canvas solution fps wise.
Last edited by Yann on Sun Sep 14, 2014 10:38 am, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Fri May 25, 2012 5:08 pm

Thanks for the example Yann, it works great!
B
9
S
3
G
3
Posts: 39
Reputation: 3,112

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jeffige, LeFuji, plinkie, Radulepy and 1 guest