The next method, CreateColCircle
, will create an object that is used for collision checks only and will not be visible.
1. To create the collision circles, insert a new method named
CreateColCircles
into thegame
class. The parameters are the parent object and the position of the circle.Method CreateColCircle:Int (parent:ftObject, xp:Float, yp:Float)
2. Now, add a local circle object via
CreateCircle
, with a radius of1.5
pixels.Local colObj:ftObject = eng.CreateCircle(1.5,xp, yp)
3. Set the layer to
layerGame
and the parent toparent
.colObj.SetLayer(layerGame) colObj.SetParent(parent)
4. Now, set the collision group and with whom to collide with to
grpCircle
.colObj.SetColGroup(grpCircle) colObj.SetColWith(grpCircle,True)
5. Since you don't want to see each circle, you set it to be invisible and then close the method.
colObj.SetVisible(False) Return 0 End