Выдрал из своего заброшенного проекта.
prcUser=LoadImage("prc.bmp")
MidHandle prcUser
MaskImage prcUser,255,255,255
Function s_construct.s(pushka,prcUser)
obj.s=New s
obj\entity=CreateSphere(2,pushka)
EntityParent obj\entity,0
ScaleEntity obj\entity,0.05,0.05,0.05
MoveEntity obj\entity,0.75,6.7,0.25
EntityType obj\entity,TypeShot
obj\upt=-1
Return obj
End Function
Function s_update()
For o.s=Each s
If o\upt=-1
o\upt=MilliSecs()
EndIf
dt=MilliSecs()-o\upt
o\upt=MilliSecs()
MoveEntity o\entity,-0.003,0.003,dt*1
If EntityDistance(o\entity,pushka)>200 Or EntityCollided (o\entity,TypeTehnika) Then
FreeEntity o\entity
Delete o
EndIf
Next
End Function
DrawImage prcUser,GraphicsWidth()/2,GraphicsHeight()/2