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

Description: Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.
Moderator: Moderators

Quantumenace
Topic author, Passerby
Passerby
Quantumenace
Topic author, Passerby
Passerby
Reputation: 0
Posts: 1
Joined: 4 Jan 2016

Post #1by Quantumenace » 5 Jan 2016, 15:54

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

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 25
Reputation: 320
Posts: 1297
Joined: 15 Feb 2014
Location: Moscow, Russia
Website Skype YouTube

Post #2by Wohlstand » 6 Jan 2016, 0:45

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.

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 20
Reputation: 13
Posts: 264
Joined: 27 Jun 2014

Post #3by Sambo » 26 Mar 2016, 3:36

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.
Image
Current Project:
Image


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest