mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 12:39:01 -06:00
Better (default) SOCD handling
This commit is contained in:
parent
0e1f40ad30
commit
438acde2e2
@ -155,18 +155,18 @@ function Ruleset:dropPiece(
|
|||||||
hard_drop_enabled, additive_gravity, classic_lock
|
hard_drop_enabled, additive_gravity, classic_lock
|
||||||
)
|
)
|
||||||
local y = piece.position.y
|
local y = piece.position.y
|
||||||
if inputs["down"] == true and drop_locked == false then
|
if inputs["up"] == true and hard_drop_enabled == true then
|
||||||
if additive_gravity then
|
|
||||||
piece:addGravity(gravity + drop_speed, grid, classic_lock)
|
|
||||||
else
|
|
||||||
piece:addGravity(math.max(gravity, drop_speed), grid, classic_lock)
|
|
||||||
end
|
|
||||||
elseif inputs["up"] == true and hard_drop_enabled == true then
|
|
||||||
if hard_drop_locked == true or piece:isDropBlocked(grid) then
|
if hard_drop_locked == true or piece:isDropBlocked(grid) then
|
||||||
piece:addGravity(gravity, grid, classic_lock)
|
piece:addGravity(gravity, grid, classic_lock)
|
||||||
else
|
else
|
||||||
piece:dropToBottom(grid)
|
piece:dropToBottom(grid)
|
||||||
end
|
end
|
||||||
|
elseif inputs["down"] == true and drop_locked == false then
|
||||||
|
if additive_gravity then
|
||||||
|
piece:addGravity(gravity + drop_speed, grid, classic_lock)
|
||||||
|
else
|
||||||
|
piece:addGravity(math.max(gravity, drop_speed), grid, classic_lock)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
piece:addGravity(gravity, grid, classic_lock)
|
piece:addGravity(gravity, grid, classic_lock)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user