Skip to content

Commit

Permalink
feat: nav to credits after completing last puzzle_set
Browse files Browse the repository at this point in the history
  • Loading branch information
russmatney committed Feb 23, 2024
1 parent 47a0cdd commit 238b94d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
9 changes: 8 additions & 1 deletion src/puzzle/GameScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func nav_to_world_map():
# TODO navigation via enum (string-less, path-less)
Navi.nav_to("res://src/menus/worldmap/WorldMapMenu.tscn")

func nav_to_credits():
Navi.nav_to("res://src/menus/Credits.tscn")

## input ###################################################################

func _unhandled_input(event):
Expand Down Expand Up @@ -125,7 +128,11 @@ func on_puzzle_win():
Store.complete_puzzle_set(puzzle_set)
await show_all_puzzles_jumbo()
await show_unlock_jumbo()
nav_to_world_map()

if puzzle_set.get_next_puzzle_set():
nav_to_world_map()
else:
nav_to_credits()
else:
if puzzle_node.puzzle_def.meta.get("show_progress"):
await show_progress_jumbo()
Expand Down
13 changes: 7 additions & 6 deletions src/puzzle/GameScene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
[ext_resource type="Script" path="res://src/PuzzleSet.gd" id="3_qrqrt"]
[ext_resource type="PackedScene" uid="uid://djqd0irfxadlp" path="res://src/DotHopCam.tscn" id="6_76inj"]

[sub_resource type="Resource" id="Resource_hnxo3"]
[sub_resource type="Resource" id="Resource_jedac"]
script = ExtResource("2_00afq")
_id = "23"
_id = "14"

[sub_resource type="Resource" id="Resource_d5xou"]
[sub_resource type="Resource" id="Resource_ffmfa"]
script = ExtResource("3_qrqrt")
_id = "26"
_id = "17"

[node name="DotHopGame" type="Node2D"]
script = ExtResource("1_ak4mv")
game_def_path = "res://src/puzzles/dothop-one.txt"
puzzle_theme = SubResource("Resource_hnxo3")
puzzle_set = SubResource("Resource_d5xou")
puzzle_theme = SubResource("Resource_jedac")
puzzle_set = SubResource("Resource_ffmfa")
puzzle_num = 11

[node name="HUD" parent="." instance=ExtResource("3_3vrse")]

Expand Down
15 changes: 8 additions & 7 deletions src/ui/components/PuzzleProgressPanel.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ext_resource type="Theme" uid="uid://rv7rm10d10gc" path="res://src/ui/BlueWoodPanelTheme.tres" id="1_tufv2"]
[ext_resource type="Script" path="res://src/ui/AnimatedVBoxContainer.gd" id="2_6lh1w"]
[ext_resource type="Script" path="res://src/ui/components/PuzzleProgressPanel.gd" id="2_mt4fd"]
[ext_resource type="Texture2D" uid="uid://8xiuvg6w0gr2" path="res://src/themes/dots/dots_player.png" id="4_nbaxf"]
[ext_resource type="Texture2D" uid="uid://dqyug4lfrx6l3" path="res://src/themes/spring/assets/player.png" id="4_aaeht"]

[node name="PuzzleProgressPanel" type="Control"]
custom_minimum_size = Vector2(396, 260)
Expand All @@ -27,7 +27,7 @@ theme = ExtResource("1_tufv2")

[node name="AnimatedVBoxContainer" type="VBoxContainer" parent="PuzzlePanelContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(158, 154)
custom_minimum_size = Vector2(252, 154)
layout_mode = 2
script = ExtResource("2_6lh1w")
child_size = Vector2(64, 64)
Expand All @@ -40,14 +40,15 @@ columns = 4

[node name="PuzzleSetIcon" type="TextureRect" parent="."]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0)
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
offset_left = 64.0
offset_top = 64.0
offset_right = 128.0
offset_bottom = 128.0
offset_left = -0.000244141
offset_top = -0.000247955
offset_right = 63.9998
offset_bottom = 63.9998
pivot_offset = Vector2(32, 32)
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource("4_nbaxf")
texture = ExtResource("4_aaeht")
stretch_mode = 4

0 comments on commit 238b94d

Please sign in to comment.