diff --git a/levels/chapter_menu/chapter_menu.gd b/levels/chapter_menu/chapter_menu.gd deleted file mode 100644 index ffe5b78..0000000 --- a/levels/chapter_menu/chapter_menu.gd +++ /dev/null @@ -1,40 +0,0 @@ -extends Node2D - -class_name ChapterMenu - -const BaseLevelScn := preload("res://levels/base_level/base_level.tscn") -const LevelButtonScn := preload("res://levels/chapter_menu/level_menu/level_button/level_button.tscn") -const LevelMenuScn := preload("res://levels/chapter_menu/level_menu/level_menu.tscn") - -# Called when the node enters the scene tree for the first time. - -@export var chapter_id : int = 0 -const button_width : int = 50 -const button_heigth : int = 50 - -func init() -> void: - var chap_num : int = LevelData.get_chapter_count() - for chap_id in range(0, chap_num): - # print(chap_id) - var level_num : int = LevelData.get_chapter_level_count(chap_id) - var button = LevelButtonScn.instantiate(); - var x : int = button_width * (chap_id % 9) + 60 - var y : int = button_heigth * (chap_id / 9) + 100 - button.init(chap_id, level_num, Vector2(x, y), 0) - button.enter_chapter.connect(_is_choose_chapter) - add_child(button) - - -func _ready(): - # print("ready") - init() - #print(LevelData.LEVEL_DATA[chapter_id]) - # print(chapter_num) - - -func _is_choose_chapter(chap_id : int, level_num : int): - var level_menu = LevelMenuScn.instantiate() - level_menu.init(chap_id, level_num) - # print("here ready to change scene to ", chapter_id) - get_tree().root.add_child(level_menu) - queue_free() diff --git a/levels/chapter_menu/chapter_menu.tscn b/levels/chapter_menu/chapter_menu.tscn deleted file mode 100644 index 86aed30..0000000 --- a/levels/chapter_menu/chapter_menu.tscn +++ /dev/null @@ -1,17 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://d138qs4pakk22"] - -[ext_resource type="Script" path="res://levels/chapter_menu/chapter_menu.gd" id="1_sfx21"] -[ext_resource type="FontFile" uid="uid://1000owdyvwfg" path="res://fonts/unifont-15.1.04.otf" id="2_y2jwf"] - -[node name="ChapterMenu" type="Node2D"] -script = ExtResource("1_sfx21") - -[node name="Label" type="Label" parent="."] -custom_minimum_size = Vector2(480, 1) -offset_top = 8.0 -offset_right = 480.0 -offset_bottom = 31.0 -theme_override_fonts/font = ExtResource("2_y2jwf") -text = "Chapter Select" -horizontal_alignment = 1 -vertical_alignment = 1