--First make a variable collide=false --Now our function function collision() if x1 + (half of the width) == x2 then collide=true end end --What the main loop should look like While true do collision() if collide==true then score = score +1 collide=false end end