New to OO and a bit slow at learning it

BlitzMax Forums/BlitzMax Beginners Area/New to OO and a bit slow at learning it

As your object (Type) has the fields your draw method requires you could do this:

	Method draw()
		SetColor red,green,blue
		If shape = 1 
			DrawOval(cx,cy,csize,csize)
		EndIf	
		If shape = 2
			DrawRect(cx,cy,csize,csize)
		EndIf
	EndMethod


Or this (which is the way I prefer)

	Method draw()
		SetColor Self.red,Self.green,Self.blue
		If Self.shape = 1 
			DrawOval(Self.cx,Self.cy,Self.csize,Self.csize)
		EndIf	
		If Self.shape = 2
			DrawRect(Self.cx,Self.cy,Self.csize,Self.csize)
		EndIf
	EndMethod


Also, I'd use a Select ... End Select block instead of your If ... EndIf part.

By the way, why did you add this? Doesn't look to me like it's being used anywhere...
Global cx,cy,csize:Int