How do I create a line like a trail

Get help using Construct 2

Post » Mon Jul 21, 2014 11:28 am

Hi,

I want to create a line on the screen when the player clicks and drag a sprite, but not working.

My script:

System> Every tick >> Sprite> Set position to ((Touch.X, Touch.Y)
                 Sprite> DragDrop is dragging >> Sprite> Spawn Sprite2 on layer 0

Leveraging the topic, I would have an idea how to simulate this line as if it were a risk of chalk.

Thanks
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Mon Jul 21, 2014 3:24 pm

To clarify, are you looking to create a line that displays where the object has been, or just draws a line from the start location to the current position?

Ok, that might have been a bit confusing, hey here's a game I made! http://www.scirra.com/arcade/addicting- ... th-friends

Would you like the "trail" to work like the paint tool or the line tool in my game?
B
11
S
3
G
1
Posts: 98
Reputation: 1,062

Post » Mon Jul 21, 2014 3:45 pm

Hi @Robsta

Thanks for reply.

I want a trail that be created where the object has been. Actually, I wanted something like the effect of Fruit Ninja (do you know this game?). I'll use fade behavior to clean the line, smoothly.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Mon Jul 21, 2014 4:36 pm

I found this a few days ago r102-loop-bug_p615625?#p615625 :)
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Mon Jul 21, 2014 4:51 pm

@TwinTails

Very cool! That's exactly what I was looking for. Thank you!
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Mon Jul 21, 2014 5:46 pm

That'll do it, and it's very similar to what I would have suggested (although I wouldn't have added the line modifying the height, having it thicker when you're moving quickly kinda looks strange).
B
11
S
3
G
1
Posts: 98
Reputation: 1,062

Post » Mon Jul 21, 2014 5:53 pm

Robsta wrote:although I wouldn't have added the line modifying the height, having it thicker when you're moving quickly kinda looks strange.


@Robsta

I noticed that. I'll try to make it a little smoother and with a continuous effect. If you have other suggestions, feel free to say. Thanks anyway.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041


Return to How do I....?

Who is online

Users browsing this forum: Fenix18, Lancifer and 52 guests