Skip to content

Commit

Permalink
添加 credits(简单实现)并使通关最后一关后会跳转 credits
Browse files Browse the repository at this point in the history
  • Loading branch information
cutekibry authored and ligen131 committed Jan 28, 2024
1 parent 06ea783 commit 844573d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions levels/chapter_menu/level_menu/level_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const I_NUMBER = ["I","II","III","VI","V"]

const LevelButton := preload("res://levels/chapter_menu/level_menu/level_button/level_button.tscn")
const BaseLevel := preload("res://levels/base_level/base_level.tscn")
const Credits := preload("res://objects/credits/credits.tscn")

# Called when the node enters the scene tree for the first time.

Expand All @@ -18,6 +19,12 @@ const button_heigth : int = 50
func init(chap_id : int, lvl_num : int) -> void:
#print("init?")

if chap_id == len(BaseLevel.instantiate().DATA):
add_child(Credits.instantiate())
$Title.set_text("")
return


if lvl_num == -1:
lvl_num = len(BaseLevel.instantiate().DATA[chap_id])

Expand Down
22 changes: 22 additions & 0 deletions objects/credits/credits.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[gd_scene load_steps=2 format=3 uid="uid://cdu8yubd7fyvb"]

[ext_resource type="FontFile" uid="uid://1000owdyvwfg" path="res://fonts/unifont-15.1.04.otf" id="1_re7ax"]

[node name="Label" type="Label"]
custom_minimum_size = Vector2(480, 256)
offset_right = 40.0
offset_bottom = 23.0
theme_override_fonts/font = ExtResource("1_re7ax")
text = "
[ Equal to P ]
Created by 玩一个四字音游导致的 @ GGJ2024
ligen131 Tsukimaru
Bunnycxk IssactheMouse
THANKS FOR PLAYING! ;-)"
horizontal_alignment = 1

0 comments on commit 844573d

Please sign in to comment.