Learn to Program 2D Games (Book)

Blitz3D Forums/Blitz3D Beginners Area/Learn to Program 2D Games (Book)

This is the code from the book.

; Initialize Blitz Basic to 640x480 resolution
Graphics 640,480

; Dimension our NameArray
Dim NameArray$(2,4)

; Assign our values to the array
NameArray$(1,1) = "John"
NameArray$(1,2) = "Joe"
NameArray$(1,3) = "Mark"
NameArray$(1,4) = "George"
NameArray$(2,1) = "Sally"
NameArray$(2,2) = "Betty"
NameArray$(2,3) = "Lorelei"
NameArray$(2,4) = "Anne"

; Set up the vertical control variable
iTextY% = 0

; loop from 1 to 2 (rows)
For iNameRow = 1 To 2
; loop from 1 to 4 (columns)
For iNameColumn = 1 To 4
Text 0,iTextY,NameArray$(iNameRow,iNameColumn)
iTextY = iTextY + 16
Next
Next

; wait for a keypress
WaitKey()

; end the program
End