CreateComet
. The parameters are the kind of comet, its position, the travel speed, and angle.Method CreateComet:ftObject(k:Int, xp:Float, yp:Float, speed:Float, speedAngle:Float)
ftObject
called com
.Local com:ftObject
If k = cmSmall Then com = eng.CreateImage(atlas, 0,32,16,16, xp, yp) com.SetRadius(4) Endif If k = cmMiddle Then com = eng.CreateImage(atlas, 32,0,32,32, xp, yp) com.SetRadius(12) Endif If k = cmLarge Then com = eng.CreateImage(atlas, 64,0,64,64, xp, yp) com.SetRadius(24) Endif
com.SetSpeed(speed, speedAngle)
com.SetAngle(Rnd(0,359)) com.SetSpin(Rnd(-4,4))
tag
field.com.SetTag(k)
com.SetWrapScreen(True)
grpComet
and the layer to layerGame
.com.SetColGroup(grpComet) com.SetLayer(layerGame)
grpComet
constant and raise cometCount
by 1
.com.SetID(grpComet) cometCount += 1 Return com End
18.218.55.14