EachIn

BlitzMax Forums/BlitzMax Beginners Area/EachIn

I found it in an unrelated code snippet :) YAY

Function createPlayers(qty=10)
	For Local n=1 To 10
		Local ship:unit=New unit
		ship.o=LoadImage("Ship\7.png")
		If n>1 Then ship.ai=1 'Make First Ship the Human Player

		ship.x=Rnd(0)
		ship.z=Rnd(0)
		ListAddLast shipList,ship
	Next
End Function


I'd tried ListAddLast before, but failed to understand how to use it properly (after creating the variable locally with New).