Error trying to create an extended type

BlitzMax Forums/BlitzMax Beginners Area/Error trying to create an extended type

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.

Using Soggy's original code and changing only the YAxis line...

Strict 
Graphics 800,600,0

Type ParentType
	Field id
	Field x#,y#
	Field xdir#, ydir#
	Field name$
	
	Function Create:ParentType(newname$)
		Local temp:ParentType = New ParentType
		temp.x = Rnd(800)
		temp.y = Rnd(600)
		temp.name$ = newname$
		Local n 
		n = Rand(2)
		If n=1 Then 
			temp.xdir = 1 
		Else
			temp.xdir = -1
		End If

		n = Rand(2)
		If n=1 Then 
			temp.ydir = 1 
		Else
			temp.ydir = -1
		End If
		
		Return temp
	End Function
	
	Method Move()
		x:+xdir
		y:+ydir
		If x<0 Or x>800 Then xdir:*-1
		If y<0 Or y>600 Then ydir:*-1
	End Method
End Type

Type YAxis Extends ParentType
		
	Method Move()
		y:+ydir
		If y<0 Or y>600 Then ydir:*-1
	End Method
End Type

Local y_axis:YAxis = YAxis (ParentType.Create("Y Only : " + Rand(100)))
Local myinstance:ParentType = ParentType.Create("X and Y : " + Rand(100))
			
While Not KeyDown(key_escape)
	Cls
	myinstance.move
	DrawText myinstance.name, myinstance.x, myinstance.y
	Flip
Wend
End