Fine tuning

This commit is contained in:
2025-09-12 23:05:23 +02:00
parent 25287c57fc
commit 0a2143d4c8
18 changed files with 49 additions and 60 deletions

View File

@ -89,7 +89,9 @@ func target_reached() -> void:
if name.contains("Magic"): if name.contains("Magic"):
self.get_node("CharacterBody2D").get_node("Sprite2D").hide() self.get_node("CharacterBody2D").get_node("Sprite2D").hide()
if randf() < 0.1: if randf() < 0.1:
target.get_parent().set_progress(max(target.get_parent().get_progress() - 60, 0)) #target.get_parent().set_progress(max(target.get_parent().get_progress() - 60, 0))
target.get_parent().set_progress(0)
target.get_parent().set_process(true)
if target: if target:
target.get_parent().enemy_hurt(hitpoint) target.get_parent().enemy_hurt(hitpoint)

View File

@ -46,4 +46,4 @@ var waves = [
] ]
var lives = 20 var lives = 20
var coins = 1500 var coins = 1000

View File

@ -23,20 +23,20 @@ var waves = [
[40, 0.7, 0.1, 0.2, 0.7], #wave 5 [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.1, 0.8, 0.2, 0.0], #wave 1 #Fith Path BOTTOMRIGHT
[3, 0.1, 0.5, 0.5, 0.0], #wave 2 [6, 0.1, 0.5, 0.5, 0.0], #wave 2
[4, 0.1, 0.4, 0.4, 0.1], #wave 3 [8, 0.1, 0.4, 0.4, 0.1], #wave 3
[4, 0.1, 0.3, 0.2, 0.5], #wave 4 [10, 0.1, 0.3, 0.2, 0.5], #wave 4
[4, 0.1, 0.1, 0.2, 0.7], #wave 5 [15, 0.1, 0.1, 0.2, 0.7], #wave 5
], ],
[ [
[2, 0.1, 0.8, 0.2, 0.0], #wave 1 #Fith Path BOTTOMRIGHT [4, 0.1, 0.8, 0.2, 0.0], #wave 1 #Fith Path BOTTOMRIGHT
[3, 0.1, 0.5, 0.5, 0.0], #wave 2 [6, 0.1, 0.5, 0.5, 0.0], #wave 2
[4, 0.1, 0.4, 0.4, 0.1], #wave 3 [8, 0.1, 0.4, 0.4, 0.1], #wave 3
[5, 0.1, 0.3, 0.2, 0.5], #wave 4 [10, 0.1, 0.3, 0.2, 0.5], #wave 4
[5, 0.1, 0.1, 0.2, 0.7], #wave 5 [15, 0.1, 0.1, 0.2, 0.7], #wave 5
] ]
] ]
var lives = 25 var lives = 25
var coins = 800 var coins = 650

View File

@ -25,4 +25,4 @@ var waves = [
] ]
var lives = 20 var lives = 20
var coins = 500 var coins = 350

View File

@ -39,4 +39,4 @@ var waves = [
] ]
var lives = 25 var lives = 25
var coins = 800 var coins = 700

View File

@ -53,4 +53,4 @@ var waves = [
] ]
var lives = 30 var lives = 30
var coins = 1200 var coins = 900

View File

@ -18,4 +18,4 @@ var waves = [
] ]
var lives = 20 var lives = 20
var coins = 800 var coins = 600

View File

@ -32,4 +32,4 @@ var waves = [
] ]
var lives = 20 var lives = 20
var coins = 800 var coins = 700

View File

@ -1556,7 +1556,7 @@ autostart = true
[node name="TrapArea" type="Area2D" parent="."] [node name="TrapArea" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="TrapArea"] [node name="CollisionShape2D" type="CollisionShape2D" parent="TrapArea"]
position = Vector2(435, 187.5) position = Vector2(435, 190)
shape = SubResource("RectangleShape2D_rec5e") shape = SubResource("RectangleShape2D_rec5e")
debug_color = Color(0.798903, 0.0385002, 1, 0.42) debug_color = Color(0.798903, 0.0385002, 1, 0.42)
@ -1577,7 +1577,7 @@ position = Vector2(587, 48)
shape = SubResource("RectangleShape2D_6egdt") shape = SubResource("RectangleShape2D_6egdt")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D2" type="CollisionShape2D" parent="TowerArea"]
position = Vector2(404.938, 206) position = Vector2(400, 199)
shape = SubResource("RectangleShape2D_n3ya7") shape = SubResource("RectangleShape2D_n3ya7")
[node name="CollisionShape2D3" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D3" type="CollisionShape2D" parent="TowerArea"]

View File

@ -521,7 +521,7 @@ size = Vector2(1081.5, 2)
size = Vector2(992, 1) size = Vector2(992, 1)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6egdt"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_6egdt"]
size = Vector2(1163, 13) size = Vector2(1163, 54.5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_n3ya7"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_n3ya7"]
size = Vector2(915.093, 2.34375) size = Vector2(915.093, 2.34375)
@ -533,7 +533,7 @@ size = Vector2(992, 0.656128)
size = Vector2(1161, 2) size = Vector2(1161, 2)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sglle"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_sglle"]
size = Vector2(163, 153) size = Vector2(163, 163)
[node name="Map2" type="Node2D"] [node name="Map2" type="Node2D"]
script = ExtResource("1_qncs7") script = ExtResource("1_qncs7")
@ -1586,7 +1586,7 @@ autostart = true
[node name="TrapArea" type="Area2D" parent="."] [node name="TrapArea" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="TrapArea"] [node name="CollisionShape2D" type="CollisionShape2D" parent="TrapArea"]
position = Vector2(435, 187.5) position = Vector2(435, 191)
shape = SubResource("RectangleShape2D_rec5e") shape = SubResource("RectangleShape2D_rec5e")
debug_color = Color(0.798903, 0.0385002, 1, 0.42) debug_color = Color(0.798903, 0.0385002, 1, 0.42)
@ -1603,15 +1603,15 @@ debug_color = Color(0.798903, 0.0385002, 1, 0.42)
[node name="TowerArea" type="Area2D" parent="."] [node name="TowerArea" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D" type="CollisionShape2D" parent="TowerArea"]
position = Vector2(587, 48) position = Vector2(587, 27.25)
shape = SubResource("RectangleShape2D_6egdt") shape = SubResource("RectangleShape2D_6egdt")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D2" type="CollisionShape2D" parent="TowerArea"]
position = Vector2(350.453, 206) position = Vector2(350, 198)
shape = SubResource("RectangleShape2D_n3ya7") shape = SubResource("RectangleShape2D_n3ya7")
[node name="CollisionShape2D3" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D3" type="CollisionShape2D" parent="TowerArea"]
position = Vector2(616, 360.328) position = Vector2(616, 358)
shape = SubResource("RectangleShape2D_xfegu") shape = SubResource("RectangleShape2D_xfegu")
[node name="CollisionShape2D4" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D4" type="CollisionShape2D" parent="TowerArea"]
@ -1619,7 +1619,7 @@ position = Vector2(579, 521)
shape = SubResource("RectangleShape2D_4tlg5") shape = SubResource("RectangleShape2D_4tlg5")
[node name="CollisionShape2D5" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D5" type="CollisionShape2D" parent="TowerArea"]
position = Vector2(1072.5, 139.5) position = Vector2(1072.5, 134.5)
shape = SubResource("RectangleShape2D_sglle") shape = SubResource("RectangleShape2D_sglle")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]

View File

@ -890,13 +890,13 @@ size = Vector2(672, 4)
size = Vector2(98, 3) size = Vector2(98, 3)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7kmhc"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_7kmhc"]
size = Vector2(125.5, 1.5) size = Vector2(125.5, 8.75)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r25yv"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_r25yv"]
size = Vector2(1162, 50) size = Vector2(1162, 50)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8x0i6"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_8x0i6"]
size = Vector2(873, 90.5) size = Vector2(873, 96)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_n15pr"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_n15pr"]
size = Vector2(34, 170) size = Vector2(34, 170)
@ -932,7 +932,6 @@ point_count = 4
script = ExtResource("1_iueon") script = ExtResource("1_iueon")
[node name="TileMap" type="TileMap" parent="."] [node name="TileMap" type="TileMap" parent="."]
visible = false
z_index = -1 z_index = -1
tile_set = SubResource("TileSet_4e145") tile_set = SubResource("TileSet_4e145")
rendering_quadrant_size = 64 rendering_quadrant_size = 64
@ -954,18 +953,17 @@ wait_time = 0.4
autostart = true autostart = true
[node name="TrapArea" type="Area2D" parent="."] [node name="TrapArea" type="Area2D" parent="."]
visible = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="TrapArea"] [node name="CollisionShape2D" type="CollisionShape2D" parent="TrapArea"]
position = Vector2(511.5, 148) position = Vector2(515, 160)
shape = SubResource("RectangleShape2D_ocvl1") shape = SubResource("RectangleShape2D_ocvl1")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="TrapArea"] [node name="CollisionShape2D2" type="CollisionShape2D" parent="TrapArea"]
position = Vector2(515, 310) position = Vector2(517, 317)
shape = SubResource("RectangleShape2D_ocvl1") shape = SubResource("RectangleShape2D_ocvl1")
[node name="CollisionShape2D3" type="CollisionShape2D" parent="TrapArea"] [node name="CollisionShape2D3" type="CollisionShape2D" parent="TrapArea"]
position = Vector2(520, 474) position = Vector2(521, 480)
shape = SubResource("RectangleShape2D_ocvl1") shape = SubResource("RectangleShape2D_ocvl1")
[node name="CollisionShape2D4" type="CollisionShape2D" parent="TrapArea"] [node name="CollisionShape2D4" type="CollisionShape2D" parent="TrapArea"]
@ -973,18 +971,17 @@ position = Vector2(47, 313.5)
shape = SubResource("RectangleShape2D_sjmo1") shape = SubResource("RectangleShape2D_sjmo1")
[node name="CollisionShape2D5" type="CollisionShape2D" parent="TrapArea"] [node name="CollisionShape2D5" type="CollisionShape2D" parent="TrapArea"]
position = Vector2(993.25, 312.75) position = Vector2(992, 323.625)
shape = SubResource("RectangleShape2D_7kmhc") shape = SubResource("RectangleShape2D_7kmhc")
[node name="TowerArea" type="Area2D" parent="."] [node name="TowerArea" type="Area2D" parent="."]
visible = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D" type="CollisionShape2D" parent="TowerArea"]
position = Vector2(568, -8) position = Vector2(568, -8)
shape = SubResource("RectangleShape2D_r25yv") shape = SubResource("RectangleShape2D_r25yv")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D2" type="CollisionShape2D" parent="TowerArea"]
position = Vector2(435.5, 538.75) position = Vector2(435.5, 536)
shape = SubResource("RectangleShape2D_8x0i6") shape = SubResource("RectangleShape2D_8x0i6")
[node name="CollisionShape2D3" type="CollisionShape2D" parent="TowerArea"] [node name="CollisionShape2D3" type="CollisionShape2D" parent="TowerArea"]
@ -1016,7 +1013,6 @@ position = Vector2(984, 569)
shape = SubResource("RectangleShape2D_tsol2") shape = SubResource("RectangleShape2D_tsol2")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]
visible = false
[node name="SidePanel" parent="CanvasLayer" instance=ExtResource("109_oxd1a")] [node name="SidePanel" parent="CanvasLayer" instance=ExtResource("109_oxd1a")]
size_flags_horizontal = 6 size_flags_horizontal = 6
@ -1024,15 +1020,12 @@ size_flags_horizontal = 6
[node name="MusicPlayer" parent="." instance=ExtResource("110_kw68t")] [node name="MusicPlayer" parent="." instance=ExtResource("110_kw68t")]
[node name="Path2D" type="Path2D" parent="."] [node name="Path2D" type="Path2D" parent="."]
visible = false
curve = SubResource("Curve2D_ocvl1") curve = SubResource("Curve2D_ocvl1")
[node name="Path2D2" type="Path2D" parent="."] [node name="Path2D2" type="Path2D" parent="."]
visible = false
curve = SubResource("Curve2D_sjmo1") curve = SubResource("Curve2D_sjmo1")
[node name="Path2D3" type="Path2D" parent="."] [node name="Path2D3" type="Path2D" parent="."]
visible = false
curve = SubResource("Curve2D_7kmhc") curve = SubResource("Curve2D_7kmhc")
[node name="Setup" type="Node" parent="."] [node name="Setup" type="Node" parent="."]

View File

@ -938,7 +938,6 @@ texture = ExtResource("66_djdyd")
[node name="Castle2" type="Sprite2D" parent="Castle"] [node name="Castle2" type="Sprite2D" parent="Castle"]
position = Vector2(638.42, 6.98877) position = Vector2(638.42, 6.98877)
scale = Vector2(1, 1)
texture = ExtResource("66_djdyd") texture = ExtResource("66_djdyd")
flip_h = true flip_h = true
@ -991,7 +990,6 @@ position = Vector2(684, 611.063)
shape = SubResource("RectangleShape2D_as1ew") shape = SubResource("RectangleShape2D_as1ew")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]
visible = false
[node name="SidePanel" parent="CanvasLayer" instance=ExtResource("67_7lums")] [node name="SidePanel" parent="CanvasLayer" instance=ExtResource("67_7lums")]
size_flags_horizontal = 6 size_flags_horizontal = 6

View File

@ -1008,7 +1008,6 @@ position = Vector2(573.5, 611.063)
shape = SubResource("RectangleShape2D_as1ew") shape = SubResource("RectangleShape2D_as1ew")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]
visible = false
[node name="SidePanel" parent="CanvasLayer" instance=ExtResource("67_ijw35")] [node name="SidePanel" parent="CanvasLayer" instance=ExtResource("67_ijw35")]
size_flags_horizontal = 6 size_flags_horizontal = 6
@ -1019,19 +1018,15 @@ size_flags_horizontal = 6
script = ExtResource("69_ju5bg") script = ExtResource("69_ju5bg")
[node name="Path2D" type="Path2D" parent="."] [node name="Path2D" type="Path2D" parent="."]
visible = false
curve = SubResource("Curve2D_hr4td") curve = SubResource("Curve2D_hr4td")
[node name="Path2D2" type="Path2D" parent="."] [node name="Path2D2" type="Path2D" parent="."]
visible = false
curve = SubResource("Curve2D_mwr61") curve = SubResource("Curve2D_mwr61")
[node name="Path2D3" type="Path2D" parent="."] [node name="Path2D3" type="Path2D" parent="."]
visible = false
curve = SubResource("Curve2D_cv1eb") curve = SubResource("Curve2D_cv1eb")
[node name="Path2D4" type="Path2D" parent="."] [node name="Path2D4" type="Path2D" parent="."]
visible = false
curve = SubResource("Curve2D_vltem") curve = SubResource("Curve2D_vltem")
[node name="Decoration" type="Node2D" parent="."] [node name="Decoration" type="Node2D" parent="."]

View File

@ -38,6 +38,7 @@ func _on_timer_timeout() -> void:
if checkend: if checkend:
endwave = false endwave = false
get_node("CanvasLayer/SidePanel").Update_waves(currentwave + 1) #updating waves get_node("CanvasLayer/SidePanel").Update_waves(currentwave + 1) #updating waves
pause = 40
if currentwave >= waves[0].size(): if currentwave >= waves[0].size():
get_node("CanvasLayer/SidePanel").Update_waves(currentwave) #updating waves get_node("CanvasLayer/SidePanel").Update_waves(currentwave) #updating waves
get_node("Timer").stop() get_node("Timer").stop()

View File

@ -5,11 +5,11 @@
[ext_resource type="Texture2D" uid="uid://l58s5yxh4f8n" path="res://Assets/Traps/Sticks/Tile2_60.png" id="2_metvu"] [ext_resource type="Texture2D" uid="uid://l58s5yxh4f8n" path="res://Assets/Traps/Sticks/Tile2_60.png" id="2_metvu"]
[ext_resource type="AudioStream" uid="uid://b00qix6a3do53" path="res://Assets/Sounds/stick trap impact.mp3" id="4_m1bdk"] [ext_resource type="AudioStream" uid="uid://b00qix6a3do53" path="res://Assets/Sounds/stick trap impact.mp3" id="4_m1bdk"]
[sub_resource type="CircleShape2D" id="CircleShape2D_m1bdk"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_m1bdk"]
radius = 32.0 size = Vector2(62.5, 35)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_metvu"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_metvu"]
size = Vector2(49.5, 18) size = Vector2(49.5, 27)
[node name="StickTrap" type="Node2D"] [node name="StickTrap" type="Node2D"]
script = ExtResource("1_metvu") script = ExtResource("1_metvu")
@ -29,14 +29,14 @@ texture = ExtResource("2_metvu")
offset = Vector2(-10, 0) offset = Vector2(-10, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"] [node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
position = Vector2(5, 0) position = Vector2(4, 2)
scale = Vector2(0.8, 0.8) scale = Vector2(0.8, 0.8)
shape = SubResource("CircleShape2D_m1bdk") shape = SubResource("RectangleShape2D_m1bdk")
[node name="Area2D" type="Area2D" parent="."] [node name="Area2D" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(4.25, 11) position = Vector2(4.25, 2.5)
shape = SubResource("RectangleShape2D_metvu") shape = SubResource("RectangleShape2D_metvu")
debug_color = Color(0.811824, 0.00210331, 0.983083, 0.42) debug_color = Color(0.811824, 0.00210331, 0.983083, 0.42)

View File

@ -82,7 +82,7 @@ func _on_timer_timeout() -> void:
for i in get_node("CharacterBody2D/Area2D").get_overlapping_bodies(): for i in get_node("CharacterBody2D/Area2D").get_overlapping_bodies():
for j in NAMES: for j in NAMES:
if i.get_parent().name.contains(j): if i.get_parent().name.contains(j):
minus += 1 minus += 0.3
health -= minus health -= minus
get_node("CharacterBody2D/ProgressBar").value = health get_node("CharacterBody2D/ProgressBar").value = health

View File

@ -67,7 +67,7 @@ position = Vector2(0, 1)
shape = SubResource("RectangleShape2D_3ht3o") shape = SubResource("RectangleShape2D_3ht3o")
[node name="Timer" type="Timer" parent="CharacterBody2D"] [node name="Timer" type="Timer" parent="CharacterBody2D"]
wait_time = 0.3 wait_time = 0.1
[node name="Area2D" type="Area2D" parent="."] [node name="Area2D" type="Area2D" parent="."]

View File

@ -48,7 +48,7 @@ func _ready() -> void:
get_node("WaveCounter").z_index = 5 get_node("WaveCounter").z_index = 5
stickspawner.connect("button_up", Spawn_Stick) stickspawner.connect("button_up", Spawn_Stick)
stickspawner.tooltip_text = "Cost: 10\nReturn: 5" stickspawner.tooltip_text = "Cost: 30\nReturn: 5"
minespawner.connect("button_up", Spawn_Mine) minespawner.connect("button_up", Spawn_Mine)
minespawner.tooltip_text = "Cost: 40\nReturn: 10" minespawner.tooltip_text = "Cost: 40\nReturn: 10"
@ -110,8 +110,8 @@ func Update_Coins(amount) -> void:
coins += amount coins += amount
func Spawn_Stick() -> void: func Spawn_Stick() -> void:
if coins >= 10: if coins >= 30:
coins -= 10 coins -= 30
var stick = STICK_TRAP.instantiate() var stick = STICK_TRAP.instantiate()
stick.name = "StickTrap-" + str(randi()) stick.name = "StickTrap-" + str(randi())
get_parent().add_child(stick) get_parent().add_child(stick)
@ -212,7 +212,7 @@ func GameWon() -> void:
file.close() file.close()
var old_score = old_scores.get(map_name, 0) var old_score = old_scores.get(map_name, 0)
if new_score > old_score: if new_score >= old_score:
old_scores[map_name] = new_score old_scores[map_name] = new_score
file = FileAccess.open(save_path, FileAccess.WRITE) file = FileAccess.open(save_path, FileAccess.WRITE)
file.store_var(old_scores) file.store_var(old_scores)