Prevent overlapping buildings

This commit is contained in:
2025-04-30 11:21:34 +02:00
parent 7d79d3f60f
commit fee9cb99cf
8 changed files with 82 additions and 11 deletions

View File

@ -92,7 +92,7 @@ animations = [{
}],
"loop": false,
"name": &"play",
"speed": 18.0
"speed": 32.0
}]
[node name="Coin" type="Node2D"]
@ -103,4 +103,17 @@ scale = Vector2(2, 2)
sprite_frames = SubResource("SpriteFrames_ibmyn")
animation = &"play"
[node name="CPUParticles2D" type="CPUParticles2D" parent="."]
amount = 80
lifetime = 0.5
speed_scale = 1.3
explosiveness = 0.3
randomness = 1.0
lifetime_randomness = 0.1
emission_shape = 1
emission_sphere_radius = 20.0
spread = 0.0
gravity = Vector2(0, -200)
damping_max = 1.0
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"]

View File

@ -14,6 +14,19 @@ func _input(event):
for i in list_of_entities:
for j in LIST_OF_ENTITIES:
if i.get_parent().name.contains(j):
match j:
"ArcherTower":
get_parent().get_node("SidePanel").Update_Coins(60)
"WizardTower":
get_parent().get_node("SidePanel").Update_Coins(30)
"MortarTower":
get_parent().get_node("SidePanel").Update_Coins(80)
"Mine":
get_parent().get_node("SidePanel").Update_Coins(10)
"StickTrap":
get_parent().get_node("SidePanel").Update_Coins(5)
"Wall":
get_parent().get_node("SidePanel").Update_Coins(0)
i.get_parent().queue_free()
queue_free()
pass