Sprite lays a line behind itself

Get help using Construct 2

Post » Tue Feb 05, 2013 4:37 pm

Hi All,

I'm creating a maze game (big thanks to @Yann for his excellent grid example). I'd like to find a way to have the player leave a line behind themselves as they move forward (so you could follow their progress from start to finish). I thought about anchoring a coloured sprite to the start point, and making it stretch to the location of the player object (which is fine for straight line movement). But as the player can turn at 90 degrees through the maze, I'm not sure this would work.

I haven't had much luck finding an answer, so if someone could point me in the right direction to get me started, I'd be very grateful.

Thanks.
B
10
S
2
G
1
Posts: 11
Reputation: 859

Post » Tue Feb 05, 2013 5:50 pm

What about a line of dots ? When the distance between the player and the last dot > threshold, then add a new dot. You could actually link those dots with the method you described, although it might look weird/jagged depending on the way the player can move.
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

Post » Tue Feb 05, 2013 7:30 pm

You can do lines just as easy as points:
http://dl.dropbox.com/u/5426011/examples16/line_trace.capx
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Tue Feb 05, 2013 8:35 pm

Thanks for the cool example @R0J0hound. I'll try implementing it into my game.
B
10
S
2
G
1
Posts: 11
Reputation: 859


Return to How do I....?

Who is online

Users browsing this forum: Ethan, makkancs, Marxally, Naightwolf, pierre244 and 19 guests