Creating more than 1 object for a list...

BlitzMax Forums/BlitzMax Beginners Area/Creating more than 1 object for a list...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Type TProps

	Field x:Int,y:Int,size:Int

	Global EntityList:TList=New TList
	
	Method Draw()		
	
	End Method 
	
	Method New()
		EntityList.AddLast(Self)
	End Method
	
	Function Create:TProps(amount:Int)
	
		For Local i:Int=0 To amount-1			
	
			Local p:TProps=New TProps		
				Local size:Int=Rnd(25,35)
				p.size=size			
				p.x=0'Rnd(0,100)
				p.y=Rnd(0,(100)							
			Return p	
		
		Next
		
	End Function

End Type


Why does the code in the Create function only return one p? What do I need to do to create the amount of p's?