Unfortunately player can't detect this error yet. I think, Zero division error(NaN, inf,-1.#IND) causes this error. You should check your code in onEnterFrame function. Notice If you give a Nan force value to applyFoce, All sprites and shapes disappear from the stage/scene. @atilim and @ar2rsawseen can you fix this debug issue? If I'm wrong, please correct me
function game:onEnterFrame(event)-- do the low-pass filtering
fdt = event.deltaTime * lowfilter + fdt *(1 - lowfilter)
world:step(fdt, 9, 3)for body,sprite inpairs(actors1)doif body.type=="ball"thenif body thenlocal bx, by = body:getPosition()
sprite:setPosition(bx, by)
sprite:setRotation(body:getAngle()*180/math.pi)endendendif self.ball1 then
ballx, bally = self.ball1.body:getPosition()-- check your force calculation!--...--local force = accel*mass--local forcex = velx/curVel * force -- Sometimes calculation may be overlooked with zero value--...
forcex =1/0-- it causes "divide by zero error"
forcey =3
self.ball1.body:applyForce(forcex, forcey, ballx, bally)--> All sprites and shapes disappear from the stage/sceneendend
Comments
You should check your code in onEnterFrame function. Notice If you give a Nan force value to applyFoce, All sprites and shapes disappear from the stage/scene. @atilim and @ar2rsawseen can you fix this debug issue? If I'm wrong, please correct me