How do I make a trail on an infinite scrolling background

Get help using Construct 2

Post » Sat Jan 20, 2018 4:09 am

https://imgur.com/a/j73Gi

Like a skier skiing down a hill he leaves a trail in the snow

What I tried :
I created a sprite for the trail and every 0.1 second I create a sprite and pin it to the background ( angle and position of the player). The issue that i'm running into is that when I reset the position of the background all the trail sprites are still pinned and now I have two trail and more and more every time I cycle is done, If I destroy the trail sprites when I reset the position of the background I lose continuity of the trail.
Last edited by brandonP on Sat Jan 20, 2018 4:29 am, edited 1 time in total.
B
39
S
18
G
4
Posts: 44
Reputation: 5,007

Post » Sat Jan 20, 2018 4:19 am

Every second?? Did you mean every tick?

You can add Fade behavior to that ski trail sprite, to make it slowly fade away and get destroyed after a few seconds.
Also instead of Pin you can add Bullet behavior with the same speed and direction as your background moves.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,366
Reputation: 84,359

Post » Sat Jan 20, 2018 4:52 am

every 0.1 second ( num lock was not active :p ), every tick is too much
getting there... now there is a new issue, so I set the trail sprite angle of mvt to the the playerangle -90 when i turn left or right the trail does not follow the mvt of the player any more


https://www.dropbox.com/s/j67t9bxv32izxi6/test.capx?dl=0
B
39
S
18
G
4
Posts: 44
Reputation: 5,007

Post » Sat Jan 20, 2018 5:24 am

I made quite a lot of changes, enjoy!
https://www.dropbox.com/s/dtcc5uplj25gw ... .capx?dl=0
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,366
Reputation: 84,359

Post » Sat Jan 20, 2018 7:53 pm

Thx man !!! you are amazing !!!
B
39
S
18
G
4
Posts: 44
Reputation: 5,007


Return to How do I....?

Who is online

Users browsing this forum: Iftikhar555 and 15 guests