The OnObjectTransition
method is detailed as follows:
1. Modify the
OnObjectTransition
method of theengine
class. Insert a local pair of position variables and a pair of counting variables.Method OnObjectTransition:Int(transId:Int, obj:ftObject) Local xp:Int Local yp:Int Local cntX:Int Local cntY:Int
2. Check if the transition ID is equal to
99
, and if so, get thex
andy
positions of the slot from the calling object.If transId = 99 Then xp = g.GetSlotX(obj) yp = g.GetSlotY(obj)
3. Now, set the slot tile with the tag value of the object.
g.SetSlotTile(xp, yp, obj.GetTag())
4. Determine the count. How many gems match at the given row and column of the object?
cntX = g.CheckGemsX(xp, yp, obj.GetTag()) cntY = g.CheckGemsY(xp, yp, obj.GetTag())
5. If there is more than one matching gem, call
CheckGems
again, but this time with an additionalTrue
flag to mark the gems or have them removed.If cntX>1 Then g.CheckGemsX(xp, yp, obj.GetTag...