Does anyone know how to make it possible to draw on the screen (like the max marker thing) but when you draw a certain shape (like a… circle) then a bomb would appear? And if you don’t draw the shape perfectly a circle it can still tell its a circle? Any help or demo project files would be appreciated
And I also need some advice about pausing game while drawing
Can any1 hlp me?
Use Input.mousePosition:
http://unity3d.com/support/documentation/ScriptReference/Input-mousePosition.html
to get the position of the mouse and save it to an array. Then cycle thru the array and try to figure out what shape has been drawn.
How experienced at scripting are you? Because if accuracy is important, this won’t be an easy task.
http://www.unifycommunity.com/wiki/index.php?title=Gesture_Recognizer
This type of thing is either quite simple (if you want users to be frustrated because it doesn’t interpret their gesture correctly) or mind-screwingly complicated if you need to support a lot of strangely-shaped gestures with accuracy.
If you couldn’t find this script yourself after 4 weeks of searching, you may have trouble making use of it. Can’t help you there, never tried.
I was actually having a think about this a minute ago when I went out for a smoke, and while I’ve never had to design or implement this sort of thing (or even read the script I linked to you), one way that you could do this would be to create a few simple polygonal shapes like a circle or square, then simply check to see if the shape the user has drawn collides with >80% of the polygons in that shape.
I suppose the horror begins when you have similar shapes, or need to support the user drawing a shape that’s a different size to the one you’re trying to compare it to, but it might be something to try if you only need basic gesture support.