Page 1 of 1

Bug: Layer:stop() sets object speeds to 0.0001 instead of 0

Posted: 5 Jan 2016, 15:54
by Quantumenace
The same thing happens if you set the layer's speedX or speedY to 0, the layer's speed then reads as 0 but blocks instead have a speed of about 0.0001. It works to use triggerEvent to call an event that stops the layer.

Code: Select all

defaultlayer = nil

function onStart()
   defaultlayer = Layer.get("Default")
   defaultlayer:stop()
end


function onLoop()
   local block = Block.get()[1]
   Text.print(block.speedX, 0, 0)
   Text.print(block.speedY, 0, 16)
   Text.print(block.x, 0, 32)
   Text.print(block.y, 0, 48)
   Text.print(defaultlayer.speedX, 0, 64)
   Text.print(defaultlayer.speedY, 0, 80)
end

Posted: 6 Jan 2016, 0:45
by Wohlstand
I think that it's SMBX's bug found by bossedit8 and shown in a video: there is a block and understroy event. You know that every event doing "layer.stop ()" even you not used layer motion engine. So, when he hited that block, it was undestroyed every hit with 0.0001 offset.

Posted: 26 Mar 2016, 3:36
by Sambo
I just experienced a similar problem. I used layer:stop() and the layer seemed to drift to the right a tiny bit. This is odd, since the layer was only moving up and down.