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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user