Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

How can I check if a player-drawn line follows a path?

$
0
0

I want to draw an invisible path that the user must follow. I’ve stored that path as points. When a player draws a line, how can I test if it follows the path I’ve stored?

Here’s an example for tracing the letter A.

example trace

if((traitSprite.getX()<=Invisible.X  && traitSprite.getX()>=Invisible.X )){...}

(traitSprite is a sprite.)


Viewing all articles
Browse latest Browse all 434

Trending Articles