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

Post » Wed Dec 12, 2012 12:29 pm

Bump
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

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
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Wed Dec 12, 2012 10:46 pm

Capx ?
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461



Return to How do I....?

Who is online

Users browsing this forum: AndreasR, beguinner, evillair, vankizzle and 8 guests