How do I create a light trail?

0 favourites
  • 6 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I'm thinking to crerate a homing missile that will leave a light trail. How to achieve that?

  • 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.

  • 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!

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have a solution that might help: Check the bottom of this thread:

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)