Initializing a Custom Type Array

BlitzMax Forums/BlitzMax Beginners Area/Initializing a Custom Type Array

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.

Hi all,

I'm working on a card game right now, and am creating a player type that (amongst other things) will keep track of their hand of 5 card objects.

I'm not sure why, but while the first example below compiles, while the second one doesn't. Can anyone help me figure out why? Thanks much.

Type TPlayer
	
	Field playerHand:TCard[] = New TCard[5] 
	
End Type


(This next one doesn't work - I get "Expecting expression but encountered '='")

Type TPlayer
	
	Field playerHand:TCard[] 
	
	Function Create()   'instantiates a player
	
		playerHand[] = New TCard[5] 
	
	End Function
End Type