Fix weapon switching, scale, add Q key bind

- Fixed weapon switching: player.gd now uses weapon_next/weapon_prev/slot actions
  (was checking for nonexistent 'weapon_toggle')
- Added Q key to weapon_next input action
- Reduced weapon scale from 0.3 to 0.07-0.08 (was still 3x too large)
This commit is contained in:
2026-07-05 23:54:57 -04:00
parent 0723b75f7b
commit fe9738ca46
8 changed files with 20 additions and 8 deletions
+13 -2
View File
@@ -227,11 +227,22 @@ func action_shoot():
# Toggle between available weapons (listed in 'weapons')
func action_weapon_toggle():
if Input.is_action_just_pressed("weapon_toggle"):
if Input.is_action_just_pressed("weapon_next"):
weapon_index = wrap(weapon_index + 1, 0, weapons.size())
initiate_change_weapon(weapon_index)
Audio.play("assets/kenney-fps/sounds/weapon_change.ogg")
if Input.is_action_just_pressed("weapon_prev"):
weapon_index = wrap(weapon_index - 1, 0, weapons.size())
initiate_change_weapon(weapon_index)
Audio.play("assets/kenney-fps/sounds/weapon_change.ogg")
for i in range(4):
if Input.is_action_just_pressed("weapon_slot_" + str(i + 1)):
if i < weapons.size():
weapon_index = i
initiate_change_weapon(weapon_index)
Audio.play("assets/kenney-fps/sounds/weapon_change.ogg")
# Initiates the weapon changing animation (tween)