pumpkin carving
This commit is contained in:
@@ -35,12 +35,12 @@ func _ready() -> void:
|
||||
)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("interact") && raycast.is_colliding() && raycast.get_collider() is Interactable:
|
||||
if EventManager.player_free && !EventManager.animation_player.is_playing() && Input.is_action_just_pressed("interact") && raycast.is_colliding() && raycast.get_collider() is Interactable:
|
||||
var interactable: Interactable = raycast.get_collider()
|
||||
interactable.interact(self)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !STILL_POSITIONS.has(animated_sprite.animation) && EventManager.player_free:
|
||||
if !STILL_POSITIONS.has(animated_sprite.animation) && EventManager.player_free && !EventManager.animation_player.is_playing():
|
||||
var input := Input.get_vector("move_left", "move_right", "move_up", "move_down").normalized()
|
||||
|
||||
var raycast_input := Vector2.ZERO
|
||||
@@ -68,3 +68,9 @@ func _physics_process(delta: float) -> void:
|
||||
animated_sprite.animation = "down"
|
||||
else:
|
||||
animated_sprite.stop()
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouse:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
elif !event.is_action("escape"):
|
||||
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
|
||||
|
||||
Reference in New Issue
Block a user