event system and keyboard
This commit is contained in:
@@ -1,6 +1,24 @@
|
||||
extends Node
|
||||
|
||||
var player_free: bool = true
|
||||
var player: Player
|
||||
|
||||
func transition() -> void:
|
||||
enum Events { NONE, PUMPKIN_CARVE, OUTSIDE_NORMAL }
|
||||
var current_event: Events = Events.NONE
|
||||
|
||||
func transition_start() -> void:
|
||||
pass
|
||||
|
||||
func transition_end() -> void:
|
||||
pass
|
||||
|
||||
func run_event(event: Events, player_postion: Vector2 = Vector2.ZERO):
|
||||
current_event = event
|
||||
transition_start()
|
||||
if player != null && player_postion != Vector2.ZERO:
|
||||
player.position = player_postion
|
||||
match event:
|
||||
Events.PUMPKIN_CARVE:
|
||||
get_tree().change_scene_to_file("uid://ccfdsdgaon63m") # scenes/levels/home.tscn
|
||||
pass
|
||||
transition_end()
|
||||
|
||||
Reference in New Issue
Block a user