mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-25 22:49:02 -06:00
Fixed a sound effect handle with negative gravity
This commit is contained in:
parent
eae58f11e9
commit
9129503d54
@ -130,8 +130,6 @@ function Piece:addGravity(gravity, grid, classic_lock)
|
||||
self:isMoveBlocked(grid, { x=0, y=-1 }) and gravity < 0
|
||||
) then
|
||||
local dropped_squares = math.floor(math.abs(new_gravity))
|
||||
local new_frac_gravity = new_gravity - dropped_squares
|
||||
self.gravity = new_frac_gravity
|
||||
if gravity >= 0 then
|
||||
local new_frac_gravity = new_gravity - dropped_squares
|
||||
self.gravity = new_frac_gravity
|
||||
@ -142,7 +140,10 @@ function Piece:addGravity(gravity, grid, classic_lock)
|
||||
else
|
||||
local new_frac_gravity = new_gravity + dropped_squares
|
||||
self.gravity = new_frac_gravity
|
||||
self:moveInGrid({ x = 0, y = -1 }, dropped_squares, grid)
|
||||
self:moveInGrid({ x=0, y=-1 }, dropped_squares, grid)
|
||||
if self:isMoveBlocked(grid, { x=0, y=-1 }) then
|
||||
playSE("bottom")
|
||||
end
|
||||
end
|
||||
else
|
||||
self.gravity = 0
|
||||
|
Loading…
Reference in New Issue
Block a user