- Home /
Question by
Deadshot1994 · Sep 29, 2015 at 01:58 PM ·
2dpuzzleshapematching
Creating a 2D shape matching game?
I am trying to create a 2D matching shape game, but I'm stuck with it. Anyone here that has any suggestions?
Also how do I make the script recognize the game object i have dragged into it?
Thanks.
Comment
Best Answer
Answer by Gilles_aerts · Oct 06, 2015 at 01:12 PM
Well comparing the shapes is not going to be easy... Another and perhaps easier way to compare it, is by assigning Tags to object. By labeling it with a tag you can devide it in groups: e.g : every square has the tag "Square" , every triangle has the tag "Triangle" etc etc..
comparing in code will be easier since you can ask an object what its tag is : e.g : if(collidedItem.tag =="Square") { debug.log("The shapes are mathing !");
}
Thank you, I forgot to add tags but it works nicely. :)