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