pumpkin carving

This commit is contained in:
2025-10-27 18:29:06 +01:00
parent b36923a196
commit bfd653c136
22 changed files with 296 additions and 29 deletions

View File

@@ -9,13 +9,10 @@ enum Events { NONE, PUMPKIN_CARVE, OUTSIDE_NORMAL }
var current_event: Events = Events.NONE
func transition_start() -> void:
player_free = false
animation_player.play("transition")
func transition_end() -> void:
animation_player.play_backwards("transition")
await animation_player.animation_finished
player_free = true
func run_event(event: Events, player_postion: Vector2 = Vector2.ZERO):
current_event = event
@@ -24,9 +21,9 @@ func run_event(event: Events, player_postion: Vector2 = Vector2.ZERO):
player.position = player_postion
match event:
Events.PUMPKIN_CARVE:
player_free = false
get_tree().change_scene_to_file("uid://ccfdsdgaon63m") # scenes/levels/home.tscn
await get_tree().scene_changed
player.animated_sprite.animation = "sit" # should be replaced with chair interaction trigger
transition_end()
func transition_scene_file(scene: String) -> void:

View File

@@ -16,12 +16,6 @@ func _notification(what: int) -> void:
if what == Window.NOTIFICATION_APPLICATION_FOCUS_OUT:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
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
func toggle_fullscreen() -> void:
if config.fullscreen:
if OS.get_name() == "Windows":