Type Slowing Game Down

Blitz3D Forums/Blitz3D Programming/Type Slowing Game Down

My game speeds having been slowing down dramatically due to the creation of a large type.

I go from 340 fps to 15 fps because I do this before the main while loop.

Help much appreciated!

Type unit
	Field playerNum
	Field team
	Field ID
	Field x#,y#,z#
	Field mesh
	Field colorR,colorG,colorB
	Field ISselected;;if ISselected, sprite is created
	Field ISmoving;;
	Field selectID;;number given to unit when selected, if 10 units are selected selectID will be 1,2,3,4,5,6,7,8,9,10
	Field starthealth#;;used to properly position health bar, when unit is hit, health bar shrinks and moves to the left
	Field health#;;currenthealth
	Field speed#	
	;;sprite
	Field selectsprite;;the select sprite unit uses when its selected
	Field selectspritetexture
	Field healthsprite;;sprite displays the units health	
	;;weapon
	Field weapon;;weapon graphic
	Field weaponrange#
	Field weapondamage#
	Field weaponalpha#
	Field weaponrate;;how frequently weapon is fired in millisecs
	Field weaponlast;;last time(gametime) weapon was fired
	;;pivot
	Field pivot;;wherever the pivot is the unit goes
	Field pivotx#,pivoty#,pivotz#
	;;;;AI fields
	Field AI;;0 - player controlled, 1 - find and destroy the nearest enemy
	
End Type

For i = 0 to 300
       aunit.unit = new unit
Next