Use Arrays, like this :
; Title
AppTitle "Data Map"
; Use These Images
; Or Download Here :D
; Graphics Mode
Graphics 640,480,16,2
SetBuffer BackBuffer()
; Render Tweening
Const UPS=60
period=1000/UPS
time=MilliSecs()-period
; Load Images
Dim brick(3)
For x = 0 To 3
; I Got This Load Array Thing From "Ross C" Some Year Ago, I Like It Alot! :D
brick(x) = LoadImage("Brick "+x+".Png")
Next
; Read Data Map
Dim map(9,9)
For y = 0 To 9 : For x = 0 To 9
Read map(x,y) : Next : Next
; Main Program
While KeyHit(1) = False
; Render Tweening
Repeat
elapsed=MilliSecs()-time
Until elapsed
ticks=elapsed/period
tween#=Float(elapsed Mod period)/Float(period)
; Draw Map
For y = 0 To 9 : For x = 0 To 9
If map(x,y) < 4 Then
; The brick(map(x,y)) Might Be A Bit Confusing, But Its All Arrays ;)
DrawImage brick(map(x,y)), x * 9 + 275, y * 9 + 195
; The x * 9 Makes Draws Them In A "Grid"
; And The + 275|195 Makes It Draw The Map *Centered*
EndIf
Next : Next
; Draw Screen
Flip
Cls
; Program End
Wend
; Free Stuff
for x = 0 to 3 : freeimage brick(x) next
; Realy End
End
; Data Map
; 0 1 2 3 4 5 6 7 8 9
Data 0, 4, 4, 4, 4, 4, 4, 4, 4, 1 ; A
Data 4, 2, 2, 2, 2, 2, 2, 2, 0, 4 ; B
Data 4, 3, 4, 4, 1, 1, 4, 4, 0, 4 ; C
Data 4, 3, 4, 4, 1, 1, 4, 4, 0, 4 ; D
Data 4, 3, 0, 0, 4, 4, 3, 3, 0, 4 ; E
Data 4, 3, 0, 0, 4, 4, 3, 3, 0, 4 ; F
Data 4, 3, 4, 4, 2, 2, 4, 4, 0, 4 ; G
Data 4, 3, 4, 4, 2, 2, 4, 4, 0, 4 ; H
Data 4, 3, 1, 1, 1, 1, 1, 1, 1, 4 ; I
Data 2, 4, 4, 4, 4, 4, 4, 4, 4, 3 ; J
|