ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >À?3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""33""DD33""DD33""DD33""DD33""33""33""33""33""33""33""3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333ü-- title: Weird Pong -- author: Lecca Linn -- desc: A weird pong project, based on the Zack Attakk Codes tutorials. -- license: CC Attribution-NonCommercial (BY-NC 4.0) -- version: 0.1 -- script: lua ax, ay = 120, 68 px, py = 0, 55 dir = 1 ud = math.random(1, 2) score = 0 speed = 1 cl = false gameOver = false function TIC() Draw() Update() end function Draw() --Verifica se deu Game Over if gameOver == true then rect(0,0,240,136,0) print("Score: "..math.floor(score),86,12,1,false,2,false) print("Game Over",76,60,2,false,2,false) print("Press Z to Restart",76,92,3,false,1,false) print("Press X to Exit",86,102,3,false,1,false) else --Cor do fundo rect(0,0,240,136,1) print("Score: "..math.floor(score),86,12,3,false,2,false) --Player rect(px,py,4,40,2) --Bola rect(ax,ay,4,4,4) --Quadra rect(0,0,239,4,3) rect(0,132,239,4,3) rect(236,0,4,136,3) end end function Update() --Verifica se deu Game Over if gameOver == true then if btn(4) then reset() elseif btn(5) then exit() end else --Cima e baixo if btn(0) then py = py - 1 end if btn(1) then py = py + 1 end --Colisao do Player com a Quadra if py > 92 then py = 92 elseif py < 4 then py = 4 end --Colisao com o Player if ax - 4 <= px then if ay - 1 >= py and ay + 1 <= py + 40 then dir = -1 end end --Limites da tela Horizontal if ax > 232 then dir = 1 cl = true elseif ax < 0 then gameOver = true end --Limites da tela Vertical if ay > 128 then ud = 2 cl = true elseif ay < 4 then ud = 1 cl = true end --Atualizacao de posicao Horizontal if dir == 1 then ax = ax - speed elseif dir == -1 then ax = ax + speed end --Atualizacao de posicao Vertical if ud == 1 then ay = ay + speed elseif ud == 2 then ay = ay - speed end --Atualizando os pontos score = score + 1/60 if math.floor(score) >= 100 then speed = 6 score = score + 1/60 elseif math.floor(score) >= 50 then speed = 5 score = score + 1/120 score = score + 1/120 elseif math.floor(score) >= 40 then speed = 4 elseif math.floor(score) >= 30 then speed = 3 elseif math.floor(score) >= 20 then speed = 2 score = score + 1/120 end end end