38 lines
747 B
Plaintext
38 lines
747 B
Plaintext
clear
|
|
tileSetLength = 32
|
|
width = 320
|
|
height = 240
|
|
cellSize = [960/width, 600/height]
|
|
colors = [color.black, color.white]
|
|
|
|
newImg = function
|
|
img = Image.create(tileSetLength, 1)
|
|
for i in range(0, tileSetLength - 1)
|
|
img.setPixel i, 0, colors[rnd * 2]
|
|
end for
|
|
return img
|
|
end function
|
|
|
|
display(5).mode = displayMode.tile
|
|
td = display(5)
|
|
td.cellSize = cellSize
|
|
td.extent = [width, height]
|
|
td.tileSetTileSize = 1
|
|
for x in range(0, width - 1)
|
|
for y in range(0, height - 1)
|
|
td.setCell x, y, rnd * tileSetLength
|
|
end for
|
|
end for
|
|
frames = 0
|
|
startTime = time
|
|
while true
|
|
td.tileSet = newImg
|
|
frames += 1
|
|
dt = time - startTime
|
|
if dt >= 1 then
|
|
text.row = 25; print "FPS: " + round(frames / dt, 2)
|
|
frames = 0
|
|
startTime = time
|
|
end if
|
|
end while
|