Randomly Placing Objects?

BlitzMax Forums/BlitzMax Beginners Area/Randomly Placing Objects?

Wellp, here's my code:
Graphics 800,600,0

'first, set the variables to make things nice and tidy
Global x = 30, y = 30, bugGen = True, killed:Int = 0


bugCounter = 0

Function execMainGame(kill:Int)

'create bugs 
Type CBugs
	Global list:TList=CreateList()
	Global saved:TList=CreateList() 
	Field cx:Int
	Field cy:Int
	Field size:Int
	' Create a new bug at the position and size specified.

	Function Create(ccx:Int,ccy:Int,size:Int=30)
		Local temp:Cbugs = New CBugs
		temp.cx=ccx
		temp.cy=ccy
		temp.size=size
		ListAddLast list,temp
	End Function

	Function draw()
		For Local all:Cbugs = EachIn list
			DrawRect all.cx,all.cy,all.size,all.size
		Next
	End Function 
End Type
Local gw:Int=800
Local gh:Int=600
Graphics gw,gh
SeedRnd MilliSecs()
' Create our rectangles with random X, Y positions.

For Local bugCounter:Int=0 To 5
	Local xpos:Int=Rand(0,gw)
	Local ypos:Int=Rand(0,gh)
	Cbugs.Create(xpos,ypos)
Next

While Not KeyHit(KEY_ESCAPE) And killed = 0 
	#main 
	'show us the info 
	SetColor 0,0,255
	DrawText "Use the arrow keys (up, down, left, right) to move the Pac-A-Dot", 0, 0
	DrawText "Use the spacebar to reset the Pac-A-Dot to the top right corner of the screen; hit ESC to quit.", 0, 10
	
	SetColor 255,255,255
	
	'make the divider bar 
	DrawRect 1,25,800,10   
	
	'make our little pac-a-dot - he's green!
	SetColor 0,255,0
	DrawOval x, y, 30, 30 
	
	'make the first set of bugs - red
	SetColor 255,0,0
	Cbugs.draw() 
	
	If Cbugs.draw = True 
	kill = 1
	EndIf 
	
	'move him around
	x = MouseX ()
	y = MouseY () 
	DrawOval x,y,30,30 
	
	'kill key for suicide
	If KeyDown(KEY_ESC) 
	kill = 1
	EndIf 
	
	'make sure he doesn't hit that text
	If y<= 30
	y = 31
	EndIf 
	
	Flip;Cls 

Wend

If kill = 1 Return 1
If kill = 0 Return 0  

End Function 

Cls 

'starting or finishing?
If(killed = 0) 
execMainGame(killed) 
EndIf 

'so, you died - too bad, but you can start again 
If(killed = 1) 
DrawText "You were killed! Sorry. Press any key to exit.",300,100
Flip 

WaitKey

EndIf 

End  


I'm getting an error which says "Types 'Int()' and 'Int' are unrelated" when I try to compile... any ideas?