ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >l!ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀ̲-- title: tictag -- author: smilure -- Configuracao do jogo -- Configuração do jogo player = {x = 64, y = 64, speed = 2} enemy = {x = 128, y = 128, speed = 1} gameOver = false -- Função de atualização do jogo function TIC() if not gameOver then movePlayer() moveEnemy() checkCollision() draw() else if btnp(4) then resetGame() end end end -- Função para movimentar o jogador com as teclas de seta function movePlayer() if btn(0) then player.y = player.y - player.speed end if btn(1) then player.y = player.y + player.speed end if btn(2) then player.x = player.x - player.speed end if btn(3) then player.x = player.x + player.speed end end -- Função para movimentar o inimigo aleatoriamente function moveEnemy() local dir = math.random(4) if dir == 1 then enemy.y = enemy.y - enemy.speed end if dir == 2 then enemy.y = enemy.y + enemy.speed end if dir == 3 then enemy.x = enemy.x - enemy.speed end if dir == 4 then enemy.x = enemy.x + enemy.speed end end -- Função para verificar colisões function checkCollision() local dx = player.x - enemy.x local dy = player.y - enemy.y local distance = math.sqrt(dx*dx + dy*dy) if distance < 8 then gameOver = true end end -- Função de desenho function draw() cls() spr(1, player.x, player.y) spr(2, enemy.x, enemy.y) if gameOver then print("Game Over", 80, 64, 15) print("Pressione Z para jogar novamente", 40, 100, 15) end end -- Função para resetar o jogo function resetGame() player.x = 64 player.y = 64 enemy.x = 128 enemy.y = 128 gameOver = false end