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
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Wed Dec 12, 2012 12:29 pm

Bump
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

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
91
S
31
G
99
Posts: 5,192
Reputation: 65,670

Post » Wed Dec 12, 2012 10:46 pm

Capx ?
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436



Return to How do I....?

Who is online

Users browsing this forum: Christmas, mekonbekon, morti, R0J0hound, Raging Melon, tarek2, waltg and 4 guests