summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-16 15:44:59 +0800
committerEltrac <hi@guhub.cn>2025-03-16 15:44:59 +0800
commitfe6d7b0fb352404dbdd9b688b52251bb69b3d8f4 (patch)
treedf4bd6e05dcd4fce263f3615a3bdd26c6b5dd41e
parent412fe36d2335addfdf260b71a93e69f5e2beacc2 (diff)
feat(controller): press ctrl + q/e to quickly move current bullet index
-rw-r--r--logic/controller.lua11
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)