Severe help needed

Blitz3D Forums/Blitz3D Programming/Severe help needed

Oh ok. Yeah. that's better. How about putting you pieces into an array? that would be easy so instead of
Function put_row()
; this is going to be BIG
For row = 0 To 9
	For col=0 To 9
		q=board(row,col)
	Select q
	Case 1
		red=CopyEntity (redpiece)
		PositionEntity red,boardx(row),4,boardz(col)
	Case 2
		blue=CopyEntity (blupiece)
		PositionEntity blue,boardx(row),4,boardz(col)
	Case 3
		violet=CopyEntity (violetpiece)
		PositionEntity violet,boardx(row),4,boardz(col)
	Case 4
		yellow=CopyEntity (yellopiece)
		PositionEntity yellow,boardx(row),4,boardz(col)
	Case 5
		redviolet=CopyEntity (redvioletpiece)
		PositionEntity redviolet,boardx(row),4,boardz(col)
	Case 6
		orange=CopyEntity (orangepiece)
		PositionEntity orange,boardx(row),4,boardz(col)
	Case 7
		bluviolet=CopyEntity (bluvioletpiece)
		PositionEntity bluviolet,boardx(row),4,boardz(col)
	Case 8
		green=CopyEntity (greenpiece)
		PositionEntity green,boardx(row),4,boardz(col)
	Case 9
		redorange=CopyEntity (redorangepiece)
		PositionEntity redorange,boardx(row),4,boardz(col)
	Case 10
		yellogreen=CopyEntity (yellogreenpiece)
		PositionEntity yellogreen,boardx(row),4,boardz(col)
	Case 11
		blugreen=CopyEntity (blugreenpiece)
		PositionEntity blugreen,boardx(row),4,boardz(col)
	Case 12
		yelloorange=CopyEntity (yelloorangepiece)
		PositionEntity yelloorange,boardx(row),4,boardz(col)
	End Select
Next

Next

End Function

do this...
Function put_row()
	For row = 0 To 9
		For col=0 To 9
			obj=CopyEntity(Piece(Board(row,col)))
			PositionEntity obj,row*10-45,4,col*10-45
		Next
	Next
End Function


Much more neat and no more nead for boardx(),boardy() arrays. Piece is an array that holds handles of the different objects.

Also, you may notice its really slow (this is probably also your problem) - you aren't deleting the objects. You are doing it like a 2d game - creating objects every frame (drawimage), but in 3d they don't go away. I would recommend just leaving the objects their, and deleting/adding as necessary.

Also, in check zero you can do Rand(1,12) instead of Rand(11)+1