täs on koodii
Code: Select all
Type AMMUS
Field obj
End Type
Repeat
If KeyDown(2) Then
Gosub ammu
EndIf
Gosub ammusten
Until EscapeKey()
ammu:
reload=0
luoti.AMMUS = New(AMMUS)
luoti\obj=CloneObject(pati)
CloneObjectPosition luoti\obj,ase
CloneObjectOrientation luoti\obj,ase
reload=5
If reload>0 Then reload=reload-1
Return
ammusten:
For luoti.AMMUS = Each AMMUS
MoveObject luoti\obj,6
If Distance2(pelihahmo,luoti\obj) Then
DeleteObject luoti\obj
Delete luoti
EndIf
Next luoti
Return