How do I create a light trail?

Get help using Construct 2

Post » Sun Mar 01, 2015 2:20 pm

I'm thinking to crerate a homing missile that will leave a light trail. How to achieve that?
You do not have the required permissions to view the files attached to this post.
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Sun Mar 01, 2015 8:49 pm

create small sprites at rockets imagepoint X/Y.
Use the Behavior Fade on the sprite and have it fade and die after X seconds. Then the trail would destroy itself after a while.
Frosty Elk AB
www.frostyelk.se
Have no fear, We come in peace!
B
13
S
3
G
1
Posts: 106
Reputation: 1,169

Post » Sun Mar 01, 2015 8:56 pm

This is what I use: I spawn the trail sprite every tick while the player or in this case missile speed > 0. Then I use the following formula to adjust the opacity: lerp(self.Opacity,0,A*dt). Adjust A with a number of your choosing, it determines the length of the trail. THen do an event compare opacity, when opacity <= 10 destroy that trail sprite :)

Best of luck!
B
6
Posts: 44
Reputation: 338

Post » Tue Mar 03, 2015 1:58 pm

Hai guys, thanks for the advices.

So I manage to implement Frostyelk suggestion. I haven't tried Basen method. But I will try it.

Here's the result. It is a nice a effect and I will use it.

Even though it is a bit different than I have imagined. Is it possible to make it look a clean smooth line rather than little boxes trails?
You do not have the required permissions to view the files attached to this post.
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Mon May 11, 2015 3:54 pm

I have a solution that might help: Check the bottom of this thread: viewtopic.php?f=148&t=117945
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Mon May 11, 2015 4:02 pm

If you are making for the pc which has more power, you can add a few things to make it look nicer.

First, change the sprite from a square into a circle. Second, It looks like you are not using every tick cause there are gaps, this is good but try reducing it a bit more to make it look smoother. And lastly, give it a sine behaviour with the size option. Play around with the settings to get the best results, but with these three, I think you can get a really nice effect.
B
35
S
16
G
29
Posts: 674
Reputation: 18,614


Return to How do I....?

Who is online

Users browsing this forum: 20170217, bulugia, pelife123, Zathan and 7 guests