change way inputs are checked in level select

This commit is contained in:
Haze Weathers 2023-06-22 15:44:59 -04:00
parent 52dd5221b0
commit b386d4ffb9

View file

@ -25,7 +25,17 @@ func _ready() -> void:
player_position.offset = target_level.offset
_select_level(selected_level)
func _input(event: InputEvent) -> void:
#func _input(event: InputEvent) -> void:
# # load selected map
# if Input.is_action_just_pressed("ui_accept"):
# Game.current_level = selected_level
# Game.change_map(LevelData.levels[selected_level].scene)
# elif Input.is_action_just_pressed("ui_right"):
# _select_level(int(clamp(selected_level + 1, 0, LevelData.levels.size() - 1)))
# elif Input.is_action_just_pressed("ui_left"):
# _select_level(int(clamp(selected_level - 1, 0, LevelData.levels.size() - 1)))
func _process(delta: float) -> void:
# load selected map
if Input.is_action_just_pressed("ui_accept"):
Game.current_level = selected_level
@ -35,7 +45,6 @@ func _input(event: InputEvent) -> void:
elif Input.is_action_just_pressed("ui_left"):
_select_level(int(clamp(selected_level - 1, 0, LevelData.levels.size() - 1)))
func _process(delta: float) -> void:
# make SG disappear inside of cave
if player_position.offset >= in_cave.offset and player_position.offset <= out_cave.offset:
player_sprite.visible = false