diff options
author | rom <romangraef@gmail.com> | 2021-04-27 02:26:24 +0200 |
---|---|---|
committer | rom <romangraef@gmail.com> | 2021-04-27 02:26:24 +0200 |
commit | 9167422d825ff1451b2eb5e877b4f4abd1a73989 (patch) | |
tree | 726be47d27ca2dacbe810d6383948f89fe1ffa7a | |
parent | 8755544fd0dbb801f8d593f5891eaee00dd4ecd5 (diff) | |
download | ldjam48-9167422d825ff1451b2eb5e877b4f4abd1a73989.tar.gz ldjam48-9167422d825ff1451b2eb5e877b4f4abd1a73989.tar.bz2 ldjam48-9167422d825ff1451b2eb5e877b4f4abd1a73989.zip |
continue
-rw-r--r-- | components/button.tscn | 1 | ||||
-rw-r--r-- | components/textreveal.gd | 4 | ||||
-rw-r--r-- | scenes/levels/puzzle/puzzle.tscn | 2 | ||||
-rw-r--r-- | scenes/levels/typeracer.tscn | 1 | ||||
-rw-r--r-- | scenes/menu.tscn | 3 | ||||
-rw-r--r-- | scenes/story/story.gd | 19 |
6 files changed, 26 insertions, 4 deletions
diff --git a/components/button.tscn b/components/button.tscn index 153f469..e3d784a 100644 --- a/components/button.tscn +++ b/components/button.tscn @@ -24,6 +24,7 @@ scale = Vector2( 4, 4 ) texture = ExtResource( 1 ) [node name="Hitbox" type="CollisionShape2D" parent="."] + [connection signal="input_event" from="." to="." method="_on_ButtonTest_input_event"] [connection signal="mouse_entered" from="." to="." method="_on_ButtonTest_mouse_entered"] [connection signal="mouse_exited" from="." to="." method="_on_ButtonTest_mouse_exited"] diff --git a/components/textreveal.gd b/components/textreveal.gd index 3520882..ab346f0 100644 --- a/components/textreveal.gd +++ b/components/textreveal.gd @@ -40,8 +40,8 @@ func _process(delta): if additional > 0: if text.ends_with("\n"): t = -7 - elif text.ends_with(" "): - t = -1 + if text.ends_with(" "): + t += 1 rect_position = -rect_size / 2 + Vector2(xpos, ypos) if to_render.length() <= revealed: started = false diff --git a/scenes/levels/puzzle/puzzle.tscn b/scenes/levels/puzzle/puzzle.tscn index ec10f81..4b061c8 100644 --- a/scenes/levels/puzzle/puzzle.tscn +++ b/scenes/levels/puzzle/puzzle.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://scenes/levels/puzzle/puzzle.gd" type="Script" id=1] -[node name="Node2D" type="Node2D"] +[node name="Node2D2" type="Node2D"] position = Vector2( 533.969, 239.439 ) script = ExtResource( 1 ) diff --git a/scenes/levels/typeracer.tscn b/scenes/levels/typeracer.tscn index 60a13b0..d9328f4 100644 --- a/scenes/levels/typeracer.tscn +++ b/scenes/levels/typeracer.tscn @@ -75,5 +75,6 @@ position = Vector2( 147.157, 130.339 ) rotation = 0.363028 scale = Vector2( -5.362, 5.362 ) texture = SubResource( 1 ) + [connection signal="text_changed" from="TextEdit" to="." method="_on_TextEdit_text_changed"] [connection signal="on_click" from="Button" to="." method="_on_Button_on_click"] diff --git a/scenes/menu.tscn b/scenes/menu.tscn index 59c935b..09b6c23 100644 --- a/scenes/menu.tscn +++ b/scenes/menu.tscn @@ -112,7 +112,7 @@ tracks/0/keys = { "values": [ Vector2( 0, 0 ), Vector2( 0, -725.715 ) ] } -[node name="Node2D" type="Node2D"] +[node name="Node2D2" type="Node2D"] script = ExtResource( 5 ) [node name="Background" type="Sprite" parent="."] @@ -218,6 +218,7 @@ anims/startgame = SubResource( 2 ) [node name="Outgoing" type="AnimationPlayer" parent="."] anims/tointro = SubResource( 3 ) anims/tosettings = SubResource( 4 ) + [connection signal="on_click" from="Content/Back" to="." method="_on_Back_on_click"] [connection signal="on_click" from="Content/HardMode" to="." method="_on_HardMode_on_click"] [connection signal="on_click" from="Content/Fullscreen" to="." method="_on_Fullscreen_on_click"] diff --git a/scenes/story/story.gd b/scenes/story/story.gd index 8681d8e..70b4b01 100644 --- a/scenes/story/story.gd +++ b/scenes/story/story.gd @@ -1,5 +1,24 @@ extends Level +const button = preload("res://components/button.tscn") + +var _continue + +func _ready(): + _continue = button.instance() + _continue.position = Vector2(0, 300) + _continue.visible = false + _continue.text = "Continue" + _continue.connect("on_click", self, "cont") + $TextrevealBox.connect("finished_reveal", self, "show_continue") + add_child(_continue) + +func cont(): + finish_level() + +func show_continue(): + _continue.visible = true + func start(): .start() $TextrevealBox.start() |