AppTitle "Zelda"
Graphics 224,176,32
SetBuffer BackBuffer()
Dim TileSet(1)
TileSet(0) = LoadImage("Floor.bmp")
TileSet(1) = LoadImage("Tree Stump.bmp")
Dim Apple_Tree_Inn(2,2)
Apple_Tree_Inn(0,0) = 0 : Apple_Tree_Inn(0,1) = 0 : Apple_Tree_Inn(0,2) = 0
Apple_Tree_Inn(1,0) = 0 : Apple_Tree_Inn(1,1) = 1 : Apple_Tree_Inn(1,2) = 0
Apple_Tree_Inn(2,0) = 0 : Apple_Tree_Inn(2,1) = 0 : Apple_Tree_Inn(2,2) = 0
While Not KeyHit(1)
Cls
For Y = 0 To 2
For X = 0 To 2
If Apple_Tree_Inn(Y,X) = 0 Then DrawImage TileSet(0),X*ImageWidth(TileSet(0)),Y*ImageHeight(TileSet(0))
If Apple_Tree_Inn(Y,X) = 1 Then DrawImage TileSet(1),X*ImageWidth(TileSet(1)),Y*ImageHeight(TileSet(1))
Next
Next
Flip
Wend
Ok, I've just written this and it works. But I was wondering if you guys knew of a better way, or a more simplistic way of writing this source code. Seems a bit long winded and maybe could be cut down. The tiles are 16x16 and Apple_Tree_Inn is the name of the area.
Looking forward to hearing from ya! ^.^
Graphics 224,176,32
SetBuffer BackBuffer()
Dim TileSet(1)
TileSet(0) = LoadImage("Floor.bmp")
TileSet(1) = LoadImage("Tree Stump.bmp")
Dim Apple_Tree_Inn(2,2)
Apple_Tree_Inn(0,0) = 0 : Apple_Tree_Inn(0,1) = 0 : Apple_Tree_Inn(0,2) = 0
Apple_Tree_Inn(1,0) = 0 : Apple_Tree_Inn(1,1) = 1 : Apple_Tree_Inn(1,2) = 0
Apple_Tree_Inn(2,0) = 0 : Apple_Tree_Inn(2,1) = 0 : Apple_Tree_Inn(2,2) = 0
While Not KeyHit(1)
Cls
For Y = 0 To 2
For X = 0 To 2
If Apple_Tree_Inn(Y,X) = 0 Then DrawImage TileSet(0),X*ImageWidth(TileSet(0)),Y*ImageHeight(TileSet(0))
If Apple_Tree_Inn(Y,X) = 1 Then DrawImage TileSet(1),X*ImageWidth(TileSet(1)),Y*ImageHeight(TileSet(1))
Next
Next
Flip
Wend
Ok, I've just written this and it works. But I was wondering if you guys knew of a better way, or a more simplistic way of writing this source code. Seems a bit long winded and maybe could be cut down. The tiles are 16x16 and Apple_Tree_Inn is the name of the area.
Looking forward to hearing from ya! ^.^