Collisions and cooldowns

This commit is contained in:
MaddoScientisto 2024-08-18 11:33:17 +02:00
commit 6ff1ab76ed
9 changed files with 105 additions and 3848 deletions

View file

@ -17,8 +17,9 @@ radius = 4.0
[sub_resource type="CircleShape2D" id="CircleShape2D_v711r"]
radius = 85.0529
[node name="Enemy" type="Area2D"]
[node name="Enemy" type="Area2D" groups=["Destroyable"]]
collision_layer = 16
collision_mask = 9
script = ExtResource("1_lpwdj")
BulletScene = ExtResource("2_ogldd")
metadata/_edit_group_ = true
@ -26,14 +27,12 @@ metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = SubResource("AtlasTexture_2brqc")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
[node name="Damage_HitBox" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_8gtts")
[node name="RigidBody2D" type="RigidBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
visible = false
position = Vector2(0, 5)
shape = SubResource("CircleShape2D_cacb5")
@ -44,5 +43,10 @@ collision_mask = 2
[node name="PlayerDetectionArea" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("CircleShape2D_v711r")
[node name="ShootTimer" type="Timer" parent="."]
wait_time = 0.4
one_shot = true
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="area_entered" from="PlayerDetection" to="." method="_on_player_detection_area_entered"]
[connection signal="area_exited" from="PlayerDetection" to="." method="_on_player_detection_area_exited"]