function draw()
smooth()
background(0, 0, 0, 255)
stroke(255)
strokeWidth(3)
fill(25, 25, 25, 255)
rect(WIDTH / 2,HEIGHT / 2, map_width * 32 + 4, map_height * 32 + 4)
strokeWidth(2)
for i,a in ipairs(map) do
for j,block in ipairs(a) do
if block >= 10 then
if block == none then
fill(127, 127, 127, 255)
rect((j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16, (i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16, 32, 32)
end
if block == bomb then
fill(50, 50, 50, 255)
rect((j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16,(i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16, 32, 32)
sprite("Tyrian Remastered:Explosion Ball",(j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16, (i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16)
end
else
font("GillSans-Bold")
fontSize(20)
fill(90, 90, 90, 255)
rect((j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16, (i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16, 32, 32)
fill(255, 255, 255, 255)
text(block,(j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16, (i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16)
end
end
end
for i,a in ipairs(cover) do
for j,coverBlock in ipairs(a) do
if coverBlock == unknown then
fill(0, 0, 0, 255)
rect((j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16,(i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16, 32, 32)
elseif coverBlock == flag then
fill(0, 0, 0, 255)
rect((j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16,(i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16,32,32)
sprite("Platformer Art:Block Special",(j - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16,(i - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16, 30, 30)
end
end
end
if selected ~= vec2(0, 0) then
fill(0, 0)
strokeWidth(3)
stroke(240, 255, 30)
rect((selected.y - 1) * 32 + WIDTH / 2 - (map_width - 1) * 16,(selected.x - 1) * 32 + HEIGHT / 2 - (map_height - 1) * 16, 32, 32)
end
clean:draw()
scFlag:draw()
font("Futura-Medium")
fill(255)
fontSize(48)
text("Time:" .. time, WIDTH / 2, 730)
fontSize(36)
text("Bomb Amount:" .. bombNum, WIDTH / 2, 680)
if gameState == over then
font("HelveticaNeue-CondensedBlack")
fill(255)
fontSize(72)
text("GAME OVER", WIDTH / 2, HEIGHT / 2)
elseif gameState == start then
if math.floor(ElapsedTime) ~= tmpTiming then
tmpTiming = math.floor(ElapsedTime)
sound("Game Sounds One:Radar")
time = time + 1
end
elseif gameState == win then
font("HelveticaNeue-CondensedBlack")
fill(255)
fontSize(72)
text("YOU WIN!!!", WIDTH / 2, HEIGHT / 2)
end
end