Draw shapes to call a function

Hey all, 

I recently played a game called darklings, which had the players draw different shapes and lines on screen to remove the enemies. I was wondering if the same could be done in Corona? For example, if I wanted the player to draw a circle to call a function, instead of a basic tap listener? Would that be possible? Thanks in advance.

That should be doable.  In your function where you handle the drawing, you will get an “end” event at some point that you can determine the shape drawn and then call a function based on that.

Rob

Thanks so much for replying. How would I determine which shape was drawn, though? What would I do, (an if statement, maybe, or a series of them?) I have done swipes before, (get the coordinates at the beginning of a touch event, and than get them at the end and compare them to determine which way they swiped) But shapes would be dealing with more than two points to compare, if you know what I mean. So what code would I use to determine which shape they had drawn?

That should be doable.  In your function where you handle the drawing, you will get an “end” event at some point that you can determine the shape drawn and then call a function based on that.

Rob

Thanks so much for replying. How would I determine which shape was drawn, though? What would I do, (an if statement, maybe, or a series of them?) I have done swipes before, (get the coordinates at the beginning of a touch event, and than get them at the end and compare them to determine which way they swiped) But shapes would be dealing with more than two points to compare, if you know what I mean. So what code would I use to determine which shape they had drawn?