Skip to content

Commit

Permalink
增加了开始按钮,缺纹理。
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunnycxk authored and ligen131 committed Jan 27, 2024
1 parent e270d70 commit 0793763
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion objects/main_menu/main_menu.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
extends AnimatedSprite2D

var ChapterMenu = preload("res://levels/chapter_menu/chapter_menu.tscn")

# Called when the node enters the scene tree for the first time.
func _ready():
Expand All @@ -15,4 +16,8 @@ func _process(delta):

func _on_animation_finished():
play("wait_for_start")
pass # Replace with function body.


func _on_start_button_pressed():
get_tree().root.add_child(ChapterMenu.instantiate())
queue_free()
7 changes: 7 additions & 0 deletions objects/main_menu/main_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,11 @@ sprite_frames = SubResource("SpriteFrames_b4517")
centered = false
script = ExtResource("14_npy3s")

[node name="start_button" type="Button" parent="."]
offset_left = 88.8
offset_top = 76.8
offset_right = 104.8
offset_bottom = 92.8

[connection signal="animation_finished" from="." to="." method="_on_animation_finished"]
[connection signal="pressed" from="start_button" to="." method="_on_start_button_pressed"]

0 comments on commit 0793763

Please sign in to comment.