any ideas why this isnt working...

BlitzMax Forums/BlitzMax Beginners Area/any ideas why this isnt working...

Global DeskWidth:Int = 1024
Global DeskHeight:Int = 768

Graphics DeskWidth, DeskHeight

SeedRnd MilliSecs() 

For Local i = 0 To 100
	Tstreak.Create() 
Next


Repeat

	Cls	
		Tstreak.update() 
		Tstreak.draw() 
	Flip
	
Until KeyHit(KEY_ESCAPE) 


Type Tstreak

Global streaks:TList = New TList
Global x:Float, y:Float, sp:Float, f:Int

Function Create() 
	Local s:Tstreak = New Tstreak
	s.x = Rand(0, DeskWidth) 
	s.y = Rand(0, 880) * -1   'i have modified this down to 880 instead of 88000 to save the wait.
	s.f = Rand(1, 4) - 1
	s.sp = Rand(4) + 2
	streaks.addlast s
End Function

Function update() 
	For Local s:Tstreak = EachIn streaks:TList
		s.y = s.y + s.sp / 10.0
		If s.y > DeskHeight
			s.y = 0 - Rand(10, 180) 
			s.x = Rand(0, DeskWidth) 
			If s.sp < 6 Then s.sp = s.sp * 1.01
		EndIf
		co = co + 1
                DrawText ("co= " + co + "  x= " + s.x + "  y= " + s.y), 500, co * 15
	Next
	SetColor 250, 200, 250
	DrawText "update count= " + co, 10, 10
End Function

Function draw() 
Local co = 0
	For Local s:Tstreak = EachIn streaks:TList
	SetColor 200, 200, 30
	DrawOval s.x, s.y, 12, 75
	Next
End Function

End Type



its supposed to make a number of streaks offset between 0and -88000 in the y direction up, kinda lazy way to offset and gradually speed up the numbers of the streaks on screen....it works in blitz3d...

anyway, now all the instances in the Tlist streaks seem to have the same x and y values, even though i am going through them one at a time and updating them, if they go off the bottom of the screen then then get put back up between -10 and -180 and their x get changed to a random position based on screen width.....they are all going to the same x and y from what i can see

Global x:Float, y:Float, sp:Float, f:Int

Needs to be
Field x:Float, y:Float, sp:Float, f:Int


i knew it was something simple....thanks....i think that is the trouble when you try and adapt some other piece of code....doh......thanks heaps again...