Making a grid and reading through it

BlitzMax Forums/BlitzMax Beginners Area/Making a grid and reading through it

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.

Basicly, I'm trying to make a modified version of tetris as a practice to improve my sloppy programming skills. But I'm trying to figure out the basic logic and I came up with GRIDS.

This is a code to test my Block Type which would be all the blocks in the game. It's a prototype...

Const Cell_Size:Int=12
Graphics 800,600

Global Test1:TBlock=New TBlock
Test1.Create(10,10,0)

Repeat


Test1.Update()
Test1.Draw()
Flip; Cls

Until KeyHit(KEY_ESCAPE)
End

Type TBlock
	Field XCell:Int
	Field YCell:Int

	Field Category:Int
	Field Rotation:Int
	
	Field HCell:Int=4
	Field VCell:Int=4
	Field UCell:Int[HCell,VCell]
	
	Method Create(xstart,ystart,catstart)
		XCell=xstart
		YCell=ystart
		Category=catstart
		
		Select Category
			Case 0
				' Normal L
				UCell[1,2]=1
				UCell[2,2]=1
				UCell[3,2]=1
				UCell[3,1]=1
			Case 1
				' Line |
				
			Case 2
			
			
		End Select
	End Method
	
	Method Update()
		
	End Method
	
	Method Draw()
		For Local i:Int = 0 To VCell
			For Local i2:Int = 0 To HCell
				If UCell[i,i2]=1 Then
					DrawRect XCell, YCell, Cell_Size, Cell_Size
				EndIf
			Next
		Next
	End Method
End Type


EDITED

So basicly
4x4
[0][0][0][0]
[0][0][0][0]
[0][0][0][0]
[0][0][0][0]

0 doesn draw
1 draws on of the figure's cube

So let's say an L
[0][0][0][1]
[1][1][1][1]
[0][0][0][0]
[0][0][0][0]