Drawing/Gesture/Tracer recognition for point/score?

Get help using Construct 2

Post » Wed Oct 15, 2014 5:37 am

I want to make a mechanic where the user is prompted with a shape they must trace or draw to earn a score based on accuracy. I'm thinking about using picking but I wanted the actual drawing overlay to look smooth and not have visible nodes or straight lines the user can easily navigate.

Does anyone know an easy way to achieve this?
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Wed Oct 15, 2014 6:44 pm

One way that comes to mind is you could calculate the distances between each point on the first stroke with the line segments of the second. Add the shortest distance for each point to a sum.

Here's an algo to find the distances:
http://stackoverflow.com/questions/8492 ... ne-segment

You probably would need to the reverse as well for the best accuracy.

In the end the lower the sum the more alike the strokes are. 0 would be perfect,
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

Post » Wed Oct 15, 2014 8:56 pm

Make the shape out of invisible sprites, and set them up in the design that you want.

Give each one an index number eg: 1 2 3 4 5 etc

If they move their finger over the invisible design in the order that the sprites are setup, then they match it.

if they go from 1 to 3 to 7, then they have messed up.

like invisible "connect the dots"
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938


Return to How do I....?

Who is online

Users browsing this forum: 25games, Artcadev, grodrigues and 25 guests