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

Description: Archive discussion
============================
Original 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.

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: 31
Reputation: 507
Posts: 1825
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

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.
Image

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 26
Reputation: 15
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: 3 guests