diff options
author | the lemons <citrons@mondecitronne.com> | 2023-03-27 22:58:32 -0500 |
---|---|---|
committer | the lemons <citrons@mondecitronne.com> | 2023-03-27 22:58:57 -0500 |
commit | 5e1feba30b356744c3c5a492aa00f154cfaea049 (patch) | |
tree | 4dfeefa99227170a7b7eb9709c056a77efe5debe | |
parent | 53358f978a0a76cffd1479c858c36fff87d3975b (diff) |
consistent lock delay when soft dropping
-rw-r--r-- | game/init.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/game/init.lua b/game/init.lua index 4edf6c4..b34a74f 100644 --- a/game/init.lua +++ b/game/init.lua @@ -28,7 +28,7 @@ function M.new(params) new.t_spun = false new.gfx = gfx.new(new) new.gravity_delay = 0.5 - new.lock_delay = params.lock_delay or 0.5 + new.lock_delay = params.lock_delay or 0.8 new.infinity = params.infinity or false new.bag = bag.new(pieces, {seed = os.time(), randomly_add = { [heav_optimal_shapes.heav] = {inverse_chance = 5000}, @@ -83,8 +83,12 @@ function M:input_loop() end end - if moved and self.infinity then - evloop.queue "game.lock_cancel" + if moved then + if self.infinity then + evloop.queue "game.lock_cancel" + elseif not self.piece:can_move(-1, 0) then + evloop.queue "game.lock" + end end return loop() |