Pointers in types??

Blitz3D Forums/Blitz3D Programming/Pointers in types??

I think this is what you're after:


Graphics 800,600,16,2

Type waypoint

	Field number
	Field x#,y#
	
End Type

Type player
	
	Field waypoint.waypoint

End Type


For n=1 To 10
	
	w.waypoint=New waypoint
	w\number=n
	w\x=Rnd(780)
	w\y=Rnd(580)

Next

player.player=New player
player\waypoint=First waypoint


Repeat
Cls

Text 400,20,"Press space to go to next waypoint",True
Text 400,40,"Current waypoint : "+player\waypoint\number,True

For w.waypoint=Each waypoint
	Oval w\x,w\y,18,18,False
	Text w\x+9,w\y+9,w\number,True,True
Next

If Sin(Float(MilliSecs())*10.0)>0

	Oval player\waypoint\x+6,player\waypoint\y+6,6,6

Else

	Oval player\waypoint\x-3,player\waypoint\y-3,24,24,False
		
EndIf

If KeyHit(57)

	player\waypoint=After player\waypoint
	If player\waypoint=Null
		player\waypoint=First waypoint
	EndIf

EndIf


Flip

Until KeyDown(1)
End