Fourth Map

This commit is contained in:
2025-09-12 15:46:49 +02:00
parent 2f9b0623f4
commit 6475051908
8 changed files with 2079 additions and 9 deletions

View File

@ -3,10 +3,10 @@ extends Node
var waves = [
[
[10, 0.2, 0.8, 0.2, 0.0], #wave 1 #First path
#[20, 0.4, 0.5, 0.5, 0.0], #wave 2
#[30, 0.5, 0.4, 0.4, 0.1], #wave 3
#[40, 0.8, 0.3, 0.2, 0.5], #wave 4
#[50, 0.9, 0.1, 0.2, 0.7], #wave 5
[20, 0.4, 0.5, 0.5, 0.0], #wave 2
[30, 0.5, 0.4, 0.4, 0.1], #wave 3
[40, 0.8, 0.3, 0.2, 0.5], #wave 4
[50, 0.9, 0.1, 0.2, 0.7], #wave 5
]
]

42
Game/Maps/Map4_setup.gd Normal file
View File

@ -0,0 +1,42 @@
extends Node
var waves = [
[
[10, 0.2, 0.8, 0.2, 0.0], #wave 1 #First path TOP
[20, 0.4, 0.5, 0.5, 0.0], #wave 2
[30, 0.5, 0.4, 0.4, 0.1], #wave 3
[40, 0.8, 0.3, 0.2, 0.5], #wave 4
[50, 0.9, 0.1, 0.2, 0.7], #wave 5
],
[
[10, 0.2, 0.8, 0.2, 0.0], #wave 1 #First path TOP
[20, 0.4, 0.5, 0.5, 0.0], #wave 2
[30, 0.5, 0.4, 0.4, 0.1], #wave 3
[40, 0.8, 0.3, 0.2, 0.5], #wave 4
[50, 0.9, 0.1, 0.2, 0.7], #wave 5
],
[
[5, 0.1, 0.8, 0.2, 0.0], #wave 1 #Third Path CENTER
[10, 0.2, 0.5, 0.5, 0.0], #wave 2
[20, 0.3, 0.4, 0.4, 0.1], #wave 3
[30, 0.4, 0.3, 0.2, 0.5], #wave 4
[40, 0.7, 0.1, 0.2, 0.7], #wave 5
],
[
[2, 0.1, 0.8, 0.2, 0.0], #wave 1 #Fourth Path TOPRIGHT
[4, 0.2, 0.5, 0.5, 0.0], #wave 2
[6, 0.3, 0.4, 0.4, 0.1], #wave 3
[10, 0.4, 0.3, 0.2, 0.5], #wave 4
[10, 0.7, 0.1, 0.2, 0.7], #wave 5
],
[
[5, 0.1, 0.8, 0.2, 0.0], #wave 1 #Fith Path BOTTOMRIGHT
[8, 0.2, 0.5, 0.5, 0.0], #wave 2
[10, 0.3, 0.4, 0.4, 0.1], #wave 3
[15, 0.4, 0.3, 0.2, 0.5], #wave 4
[15, 0.7, 0.1, 0.2, 0.7], #wave 5
]
]
var lives = 25
var coins = 800

View File

@ -0,0 +1 @@
uid://dmm8y7nys44nb

File diff suppressed because one or more lines are too long

1983
Game/Maps/map_4.tscn Normal file

File diff suppressed because one or more lines are too long

View File

@ -17,8 +17,6 @@ func _ready() -> void:
if i.name.contains("Path2D"):
paths.append(i)
waves = get_node("Setup").waves
print(waves)
print(paths)
#the meaning of the columns inside my wave generation matris:
# Number of enemies need to be spawned, chance of spawn an enemy, chance of forkman, chance of gobline, chance of ork
@ -36,6 +34,7 @@ func _on_timer_timeout() -> void:
break
checkend = true
currentwave += 1
break
if checkend:
endwave = false
get_node("CanvasLayer/SidePanel").Update_waves(currentwave + 1) #updating waves

View File

@ -16,12 +16,17 @@ func LoadMap3() -> void:
get_tree().change_scene_to_file("res://Game/Maps/map_3.tscn")
pass # Replace with function body.
func LoadMap4() -> void:
get_tree().change_scene_to_file("res://Game/Maps/map_4.tscn")
pass # Replace with function body.
func _ready() -> void:
loadData()
get_node("VBoxContainer/HBoxContainer/first/Button").connect("button_up", LoadMap1)
get_node("VBoxContainer/HBoxContainer/second/Button").connect("button_up", LoadMap2)
get_node("VBoxContainer/HBoxContainer/third/Button").connect("button_up", LoadMap3)
get_node("VBoxContainer/HBoxContainer/fourth/Button").connect("button_up", LoadMap4)
var unlocker = true
for i in get_node("VBoxContainer").get_children():
@ -42,17 +47,21 @@ func _ready() -> void:
func loadData() -> void:
if FileAccess.file_exists(save_path):
var file = FileAccess.open(save_path, FileAccess.READ)
if file:
map_scores = file.get_var()
print(map_scores)
file.close()
get_node("VBoxContainer/HBoxContainer/first/Label2").text = "Haven't finished yet" if map_scores["Map1"] == 0 else "Scored: " + str(map_scores["Map1"]) + " out of 10"
get_node("VBoxContainer/HBoxContainer/second/Label2").text = "Haven't finished yet" if map_scores["Map2"] == 0 else "Scored: " + str(map_scores["Map2"]) + " out of 10"
get_node("VBoxContainer/HBoxContainer/third/Label2").text = "Haven't finished yet" if map_scores["Map3"] == 0 else "Scored: " + str(map_scores["Map3"]) + " out of 10"
get_node("VBoxContainer/HBoxContainer/fourth/Label2").text = "Haven't finished yet" if map_scores["Map4"] == 0 else "Scored: " + str(map_scores["Map4"]) + " out of 10"
else:
map_scores["Map1"] = 0
map_scores["Map2"] = 0
map_scores["Map3"] = 0
map_scores["Map4"] = 0
save_scores()
loadData()

View File

@ -237,6 +237,42 @@ layout_mode = 2
size_flags_horizontal = 4
text = "Score: 10 / "
[node name="fourth" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
alignment = 1
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/fourth"]
layout_mode = 2
size_flags_horizontal = 4
text = "3rd Level"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer/fourth"]
custom_minimum_size = Vector2(120, 80)
layout_mode = 2
theme_override_styles/disabled = SubResource("StyleBoxTexture_44oc2")
theme_override_styles/hover = SubResource("StyleBoxTexture_losb8")
theme_override_styles/normal = SubResource("StyleBoxTexture_44oc2")
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/HBoxContainer/fourth/Button"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("6_udeaf")
[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer/fourth"]
layout_mode = 2
size_flags_horizontal = 4
text = "Score: 10 / "
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 12