Touch Screen Drawing

Get help using Construct 2

Post » Mon May 27, 2013 6:12 pm

Hello everyone! Not my first post, but it has been years (and I think it was before Construct 2) so hello again :)

On to business.

In very simple terms I am trying to create a touch-screen interaction where you can tap between two points and create a direct line, or tap and drag to draw a more complex one. Whichever method you take it should create a single line.

The purpose of this is to build a path for another sprite to follow with straight lines offering the ability to build up speed and twisty ways allowing the player to avoid obstacles.

I looked through the FAQ but the only thing that looked promising was checkpoints, but that's pretty fundamentally different.

So far I've managed to use the On Any Touch Start and On Any Touch End Events to create waypoints, and then the Is In Touch Event to draw a series of points along a traced line BUT I don't know how to (or even if I can) connect them so they look more like a line and less like a bunch of independent points. Then from there how to put them into an array so the player's sprite can follow them in order.

TL;DR: How can I use the Touch object's Events to draw a line (by tapping or dragging) that a sprite will follow?
B
6
G
3
Posts: 10
Reputation: 1,121

Post » Wed May 29, 2013 3:02 pm

So I've started looking into the Pathfinding behavior as a solution but I can't find any tutorials on the subject (plenty on Pathfinding for other uses, and a really good one about creating enemies with a line-of-sight behavior, but none about using pathfinding as a railroad.

I think if I do find some way to accomplish this I will make a tutorial, regardless I'm going to continue chronicling my attempts here. If anyone has any insight please let me know.
B
6
G
3
Posts: 10
Reputation: 1,121


Return to How do I....?

Who is online

Users browsing this forum: unicornspitfire and 29 guests