You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			28 lines
		
	
	
		
			837 B
		
	
	
	
		
			GDScript
		
	
			
		
		
	
	
			28 lines
		
	
	
		
			837 B
		
	
	
	
		
			GDScript
		
	
| extends Node3D
 | |
| class_name PlayerInput
 | |
| 
 | |
| @onready var status = (%Status as Status)
 | |
| @onready var combo = (%Combo as Combo)
 | |
| 
 | |
| var action_map = {}
 | |
| 
 | |
| func _ready():
 | |
| 	SignalManager.connect("input_action_pressed",on_input_action_pressed)
 | |
| 	SignalManager.connect("input_action_pressed",on_input_action_released)
 | |
| 	SignalManager.connect("input_action_move",on_input_action_move)
 | |
| 
 | |
| func on_input_action_pressed(event:InputEvent):
 | |
| 	for action_name in InputMap.get_actions():
 | |
| 		if event.is_action(action_name):
 | |
| 			if not action_name in action_map:
 | |
| 				action_map[action_name] = true
 | |
| 				combo.add_input_action(action_name)
 | |
| 	
 | |
| func on_input_action_released(event:InputEvent):
 | |
| 	for action_name in InputMap.get_actions():
 | |
| 		if event.is_action(action_name):
 | |
| 			action_map.erase(action_name)
 | |
| 
 | |
| func on_input_action_move(input_dir):
 | |
| 	status.input_dir = input_dir
 |