Smooth Trails

Get help using Construct 2

Post » Wed Dec 12, 2012 2:52 am

Hey Guys !
I'm in a hurry ... I will post fast !
So , I'm making a trail but I'm seeing that the trail isn't smooth when using big objects like big squares and the object can get spaced when traveling at a big speed ... How can I make a smooth trails like in Bit Trip Runner serie ?

Thanks for answering !
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Wed Dec 12, 2012 12:29 pm

Bump
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Wed Dec 12, 2012 6:31 pm

If you store the object's old position you could position trail sprites in between by lerping between the two. Something like this:

repeat 10 times
create trail at lerp(obj.x,oldx, loopindex/10), lerp(obj.y,oldy, loopindex/10)

And if you want the trails to be a fixed distance apart you could do something like this:

repeat distance(obj.x, obj.y, oldx, oldy)/10 times
spawn trail at obj
move trail loopindex*10 pixels at angle(obj.x, obj.y, oldx, oldy)
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Wed Dec 12, 2012 10:46 pm

Capx ?
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564



Return to How do I....?

Who is online

Users browsing this forum: MrLOL64 and 20 guests