How do I create a trail

Get help using Construct 2

Post » Wed Aug 05, 2015 3:05 pm

I want to create a trail like in this video https://www.youtube.com/watch?v=um1JY91HQYE (its thicker at the tail and and thinner at the back of the plane)
B
14
S
3
G
1
Posts: 69
Reputation: 950

Post » Wed Aug 05, 2015 3:18 pm

Hi!

You need to pin an object beside your avatar and create two variables that store the previous avatar position.

Then set the following events:

Set object WIDTH to distance(Object_Initial_Pos_X,Object_Initial_Pos_Y,Actual_Pos.X,Actual_Pos.Y)
Set object HEIGHT to Self.Width/15
Set object ANGLE to angle(Object_Initial_Pos_X,Object_Initial_Pos_Y,Actual_Pos.X,Actual_Pos.Y)
System set Object_Initial_Pos_X to Actual_Pos.X
System set Object_Initial_Pos_Y to Actual_Pos.Y

PS.: The Actual_Pos is the actual position of the moving object. I did this to a slice casual game, so I think it will work well with your game.

Good luck! ;)
B
39
S
9
G
3
Posts: 260
Reputation: 4,357

Post » Wed Aug 05, 2015 6:54 pm

also look at particles - warning keep an eye on how many particle you are creating...

https://db.tt/nol4NJZ5

Image

edit to add image 6/8/15
Last edited by RamPackWobble on Thu Aug 06, 2015 6:44 am, edited 1 time in total.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Wed Aug 05, 2015 7:02 pm

@lukezero thanks, but where should I put those events? Should I use an every tick or ?
B
14
S
3
G
1
Posts: 69
Reputation: 950

Post » Wed Aug 05, 2015 7:51 pm

@roteam There is a CAPX example that I made for you: ;)

http://s000.tinyupload.com/index.php?fi ... 5131704871
B
39
S
9
G
3
Posts: 260
Reputation: 4,357


Return to How do I....?

Who is online

Users browsing this forum: batto and 26 guests