The problem in this game is that sometimes it will report collisions of objects that are still in action, basically, when they pass by each other. For this, we check if the ID of the object's parent is bigger than the one of the second object's parent. If yes, the second object will start a transition.
1. Inside the method
OnObjectCollision
, check if the collision group is equal tog.grpCircle
.Method OnObjectCollision:Int(obj:ftObject, obj2:ftObject) If obj.collGroup = g.grpCircle Then
2. Now, check whether the ID of the first parent
obj
is bigger than the second one and also that the second parent ID is positive. Negative ones are still in transition.If (obj.GetParent().GetID() > obj2.GetParent().GetID()) And (obj2.GetParent().GetID() >= 0) Then
3. Raise the game score.
g.score += 1
4. Check whether the second parent object is in transition. If not, then start a rotation transition by relative 90 degrees to its current angle and...