diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-16 15:44:59 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-16 15:44:59 +0800 |
| commit | fe6d7b0fb352404dbdd9b688b52251bb69b3d8f4 (patch) | |
| tree | df4bd6e05dcd4fce263f3615a3bdd26c6b5dd41e | |
| parent | 412fe36d2335addfdf260b71a93e69f5e2beacc2 (diff) | |
feat(controller): press ctrl + q/e to quickly move current bullet index
| -rw-r--r-- | logic/controller.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/logic/controller.lua b/logic/controller.lua index 211a745..066564e 100644 --- a/logic/controller.lua +++ b/logic/controller.lua @@ -14,10 +14,21 @@ local function playerChangeNextBullet(key) G.player.nextBullet = G.player.nextBullet +1 end + -- shortcut: press number key to move to a specific index local i = tonumber(key) if i ~= nil then G.player.nextBullet = i end + + -- shortcut: press ctrl/command + q/e + -- to quickly move to the start/end of the heart sequence + if controller.ctrlKeyPressed() then + if key == "q" then + G.player.nextBullet = 1 + elseif key == "e" then + G.player.nextBullet = #G.player.hearts + end + end end local function playerPressKeysToMoves(dt) |
