PARABÉNS %s
'):format(jogadores[g]), nil, 100, 0, 600, 400, -1, -1, 0) end end tfm.exec.newGame(xml) ui.setMapName('Velha 2') local corDeEspaco = 'BABD2F' local windows95window = { {img="17fcc19defe.png", w=3, h=20}, {img="17f8400d793.png", w=1, h=20}, {img="17f840196d7.png", w=3, h=20}, {img="17f83df8406.png", w=3, h=1}, {img="17f83dfe21f.png", w=1, h=1}, {img="17f83e04755.png", w=3, h=1}, {img="17f83e0a283.png", w=3, h=3}, {img="17f83e0fd89.png", w=1, h=3}, {img="17f83e1586f.png", w=3, h=3}, } local padrao = { {img="17f85ff6afb.png", w=28, h=29}, {img="17f86018555.png", w=8, h=29}, {img="17f8601f67b.png", w=28, h=29}, {img="17f860256e6.png", w=28, h=4}, {img="17f8602b3f0.png", w=8, h=4}, {img="17f86038225.png", w=28, h=4}, {img="17f8603de5f.png", w=28, h=29}, {img="17f86043b4a.png", w=8, h=29}, {img="17f86049374.png", w=28, h=29}, } local imgUsada = math.random(100) local fatia if imgUsada < 8 then fatia = windows95window else fatia = padrao end --créditos: ninguem#0095 local nineSlicedRect = function(source, target, targetPlayer, x, y, width, height) return { tfm.exec.addImage (source[1].img, target, x, y, targetPlayer, 1, 1), tfm.exec.addImage (source[2].img, target, x+source[1].w, y, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1), tfm.exec.addImage (source[3].img, target, x+width-source[3].w, y, targetPlayer, 1, 1), tfm.exec.addImage (source[4].img, target, x, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h), tfm.exec.addImage (source[5].img, target, x+source[1].w, y+source[1].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, (height-source[1].h-source[7].h)/source[4].h), tfm.exec.addImage (source[6].img, target, x+width-source[6].w, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h), tfm.exec.addImage (source[7].img, target, x, y+height-source[7].h, targetPlayer, 1, 1), tfm.exec.addImage (source[8].img, target, x+source[7].w, y+height-source[8].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1), tfm.exec.addImage (source[9].img, target, x+width-source[9].w, y+height-source[9].h, targetPlayer, 1, 1), } end local makeMap = function(p) ui.addTextArea(11, ("%s"):format(jogadores[1]), p, 73-50, 365, 100, 20, nil, nil, 0, false)
ui.addTextArea(12, (" %s"):format(jogadores[2]), p, 725-50, 365, 100, 20, nil, nil, 0, false)
nineSlicedRect(fatia, '_1', p, 400-125, 185-115, 250, 230)
end
local analisarJogador = function(p)
makeMap(p)
system.bindKeyboard(p, 32, true, true)
tfm.exec.respawnPlayer(p)
end
eventNewGame = analisarJogador
for k in next, tfm.get.room.playerList do
analisarJogador(k)
end
eventNewPlayer = analisarJogador
makeMap()
eventKeyboard = function(p, k, _, x)
if x < 103 and x > 47 and jogadores[1] == '[ espaço ]' and p ~= jogadores[2] then
jogadores[1] = p
makeMap()
end
if x < 758 and x > 688 and jogadores[2] == '[ espaço ]' and p ~= jogadores[1] then
jogadores[2] = p
makeMap()
end
end
eventChatCommand = function(p, c)
if p == (debug.traceback()):match('(%w*%#%d+)') then
if c == 'reset' then
for i=1, 9 do
limpar(i)
end
mapa = {
0, 0, 0,
0, 0, 0,
0, 0, 0
}
ui.addTextArea(-9, '', nil, -9999, -9999)
ultimosMov = {{0,0,0}, {0,0,0}}
end
end
end