TypeinsideType ..what's wrong?

Blitz3D Forums/Blitz3D Programming/TypeinsideType ..what's wrong?

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.

Say, I was thinking about if it is possible to use the type-like properties of Entities. Using the parent-child structure, you can link items very flexible. If you combine this method with types, it is possible to create types within a type:
;-----------------------------------------------------------------------------------------------------
;											   Setup Graphics
;-----------------------------------------------------------------------------------------------------

	;setup graphics
	Graphics3D 800, 600, 0, 2
	SetBuffer BackBuffer()
	
	;setup camera	
	camera = CreateCamera()
	MoveEntity camera, 0, 0, -15

;-----------------------------------------------------------------------------------------------------
;												Setup Pivots
;-----------------------------------------------------------------------------------------------------
	
	;create global parent	
	fish = CreatePivot()
	
	;create parent for sharks/whales
	sharks = CreatePivot(fish)
	whales = CreatePivot(fish)

;-----------------------------------------------------------------------------------------------------
;											   Create Entities
;-----------------------------------------------------------------------------------------------------
	
	;create 10 sharks
	For i = 0 To 9
		
		shark = CreateCube(sharks)
		PositionEntity  shark, Rnd(-10, 10), Rnd(-10, 10), Rnd(-10, 10)
		EntityColor		shark, 0, 0, 255
		RotateEntity	shark, 0, Rand(360), 0
		
	Next
	
	;create 10 whales
	For i = 0 To 9
	
		whale = CreateCube(whales)
		PositionEntity  whale, Rnd(-10, 10), Rnd(-10, 10), Rnd(-10, 10)
		EntityColor		whale, 255, 0, 0
		RotateEntity	whale, 0, Rand(360), 0
		
	Next
	
;-----------------------------------------------------------------------------------------------------
;												   Main Loop	
;-----------------------------------------------------------------------------------------------------
	Repeat


		;handle all sharks	
		For i = 1 To CountChildren(sharks)
			
			shark = GetChild(sharks, i)
			MoveEntity shark, 0, 0, 0.1
			TurnEntity shark, 0, 1, 0
			
		Next

		
		;handle all whales
		time# = MilliSecs() / 40.0		
		For i = 1 To CountChildren(whales)
			
			whale = GetChild(whales, i)
			PositionEntity whale, EntityX(whale), Sin(time + i * 20) * 10, EntityZ(whale)
		
		Next

			
		;render everything
		RenderWorld()	
		Flip
		

	Until KeyHit(1)
	
	End
	
;-----------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------