for i = 1, #obj do
if checkCollision(player.x,player.y,player.size,player.size, obj[i].x,obj[i].y,obj[i].size,obj[i].size) then
if obj[i].numeroaleatorio == 8 or obj[i].numeroaleatorio == 5 or obj[i].numeroaleatorio == 15 or obj[i].numeroaleatorio == 18 or obj[i].numeroaleatorio == 9 or obj[i].numeroaleatorio == 1 or obj[i].numeroaleatorio == 20 then
table.remove(collidedwith, i)
pontos = pontos + 1
if pontos >= 6 then win = true gameover = false end
else
if not pontos <= 0 then pontos = pontos - 1 else gameover = true win = false end
end
end
end
local trueNumbers = {8=true, 5=true, 15=true, 18=true, 9=true, 1=true, 20=true}
for i = #objects, 1, -1 do
local obj = objects[i]
if checkObjCollision (player, obj) and trueNumbers[obj.number] then
table.remove(objects, i)
bridgesAmount = bridgesAmount + 1
win = isWin ()
gameover = IsGameOver ()
end
end
Last edited by darkfrei on Sat Mar 25, 2023 10:05 pm, edited 1 time in total.
Hi, please use the Support and Development subforum for these threads. This Ports subforum is just meant to be about different platforms people have got love to run on.
(edit: I moved all your threads for you. Please stop posting general support questions in the Ports subforum.)