added loading through animation player

This commit is contained in:
Nikolai Fesenko
2025-08-30 18:02:55 +02:00
parent c0cac7919a
commit b4d7680213
6 changed files with 153 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
extends Node
signal bullet_shoot
signal bullet_selected(object)
signal state_changed
@@ -18,11 +18,11 @@ var is_player2_loaded: bool = false
var bullet_stack: Node3D
func _ready() -> void:
bullet_shoot.connect(on_bullet_shoot)
bullet_selected.connect(on_bullet_selected)
func _input(event: InputEvent) -> void:
if event.is_action_released("load"):
player1_revolver.load_bullet(bullet_stack.bullets[0])
set_state(GameState.PLAYER1_GUN_LOAD)
elif event.is_action_released("load2"):
player1_revolver.load_bullet(bullet_stack.bullets[1])
@@ -91,3 +91,7 @@ func get_phase2_player_start():
set_state(GameState.PLAYER1_UNLOAD)
else:
set_state(GameState.PLAYER2_UNLOAD)
func on_bullet_shoot(target):
pass