moving target

Blitz3D Forums/Blitz3D Programming/moving target

Try making the camera a child of the turret.


You could also get rid of your GOTO (and the THENs) using this adaptation of your update_bullet() function.


Function update_bullet()
	For b.bullet = Each bullet
		MoveEntity b\entity,0,0,b\speed ; this is my collision modification HERE
			If EntityCollided (b\entity,1) ; no one would help with entitycollided
				;kill = kill-1
				score = score+10 	; update socre
				FreeEntity b\entity  ; kill bullet if it hits
				FreeEntity b\pivot 
				Delete hit.badman
				Delete b.bullet 

			Else   ;Better than GOTO 

				If EntityDistance#(b\entity,b\pivot) > b\range
					FreeEntity b\entity
					FreeEntity b\pivot
					Delete b.bullet
				Endif

			End If
	Next
End Function



Hope this helps

Nik.