Turning functions into methods help

BlitzMax Forums/BlitzMax Beginners Area/Turning functions into methods help

Type TPlayer
	Field x 
	Field y  
	Field sp
	Field si
	
	Method UpdatePlayers()
		If KeyDown(KEY_LEFT)  Then x=x-sp
		If KeyDown(KEY_RIGHT) Then x=x+sp
	End Method

	Method DrawPlayers()
		SetColor 255,100,0  
		DrawRect x,y,si,si
		SetColor 255,255,255
	End Method
	
	Function Create:TPlayer(x,y,sp,si)
		Local p:TPlayer

		p=New TPlayer
		p.x=x
		p.y=y
		p.sp=sp
		p.si=si
	
		ListAddLast plist,p
 
		pcount=pcount+1
		Return p
	End Function
End Type

Global Player1:TPlayer = TPlayer.Create(1,2,3,4)