forked from team-sg/hero-mark-2
figured it out lol
This commit is contained in:
parent
45ffc4d3b7
commit
d5260e5ec6
3 changed files with 413 additions and 5 deletions
|
@ -131,6 +131,16 @@ func _gui_input(event: InputEvent) -> void:
|
|||
selected_shard = posmod(selected_shard - 1, 8)
|
||||
shard_title.text = LevelData.levels[selected_level].shard_titles[selected_shard]
|
||||
shard_arrow.position.x = filled_shards.get_child(selected_shard).position.x
|
||||
elif event.is_action_pressed("next_level"):
|
||||
var level = int(clamp(selected_level + 1, 0, LevelData.levels.size() - 1))
|
||||
if _can_travel(level):
|
||||
_select_level(level)
|
||||
_update_stats(false)
|
||||
elif event.is_action_pressed("prev_level"):
|
||||
var level = int(clamp(selected_level - 1, 0, LevelData.levels.size() - 1))
|
||||
if _can_travel(level):
|
||||
_select_level(level)
|
||||
_update_stats(false)
|
||||
|
||||
func _select_level(level_id: int) -> void:
|
||||
var level = LevelData.levels[level_id]
|
||||
|
@ -197,7 +207,7 @@ func _travel_to_level(level_name: String) -> void:
|
|||
tween.tween_callback(hop_tween, "kill")
|
||||
tween.tween_property(player_sprite, "position:y", -2.0, 0.0)
|
||||
|
||||
func _update_stats() -> void:
|
||||
func _update_stats(popup: bool = true) -> void:
|
||||
# fill in level panel information
|
||||
var save_id = LevelData.levels[selected_level].save_id
|
||||
var save_data: Save.LevelSaveData = Save.current_file.levels[save_id]
|
||||
|
@ -212,8 +222,12 @@ func _update_stats() -> void:
|
|||
$"%BossFlavorText".text = "Speediest Smashing"
|
||||
11:
|
||||
$"%PressStartBoss".text = "Press Start To Change The Future!"
|
||||
$"%BossFlavorText".text = "Fastest Future"
|
||||
animation_player.play("show_boss")
|
||||
$"%BossFlavorText".text = "Fastest Future"
|
||||
if popup:
|
||||
animation_player.play("show_boss")
|
||||
elif not boss_shown:
|
||||
$AuxPlayer.play("hide_stats")
|
||||
animation_player.play("show_boss")
|
||||
boss_shown = true
|
||||
else:
|
||||
score_any.text = "%05d" % save_data.score_any
|
||||
|
@ -226,7 +240,12 @@ func _update_stats() -> void:
|
|||
selected_shard = 0
|
||||
shard_title.text = LevelData.levels[selected_level].shard_titles[selected_shard]
|
||||
shard_arrow.position.x = filled_shards.get_child(selected_shard).position.x
|
||||
animation_player.play("show_stats")
|
||||
if popup:
|
||||
animation_player.play("show_stats")
|
||||
elif boss_shown:
|
||||
$AuxPlayer.play("hide_boss")
|
||||
animation_player.play("show_stats")
|
||||
boss_shown = false
|
||||
|
||||
|
||||
func _on_StayHere_pressed() -> void:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue