The next method, CreateColCircle
, will create an object that is used for collision checks only and will not be visible.
CreateColCircles
into the game
class. The parameters are the parent object and the position of the circle.Method CreateColCircle:Int (parent:ftObject, xp:Float, yp:Float)
CreateCircle
, with a radius of 1.5
pixels.Local colObj:ftObject = eng.CreateCircle(1.5,xp, yp)
layerGame
and the parent to parent
.colObj.SetLayer(layerGame) colObj.SetParent(parent)
grpCircle
.colObj.SetColGroup(grpCircle) colObj.SetColWith(grpCircle,True)
colObj.SetVisible(False) Return 0 End
By creating invisible collision objects, we can automize the collision detection later on. We don't have to check at which angle an atom will be, because the circles will spin with their parent atom element.
18.227.10.162