This commit is contained in:
2025-09-04 19:18:28 +02:00
parent 3f2ca68a4f
commit 6e599c8f1c
5 changed files with 30 additions and 26 deletions

View File

@@ -1,11 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://ditud5veuxqyb"]
[gd_scene load_steps=3 format=3 uid="uid://ditud5veuxqyb"]
[ext_resource type="Script" uid="uid://b8a23hkmesx0l" path="res://script/asteroid.gd" id="1_p0ukn"]
[ext_resource type="Texture2D" uid="uid://dbingmvgsgvfv" path="res://assets/asteroidx1.png" id="1_u87q6"]
[sub_resource type="CircleShape2D" id="CircleShape2D_p0ukn"]
radius = 14.0357
[node name="asteroid" type="RigidBody2D"]
collision_layer = 2
collision_mask = 2
@@ -17,9 +14,7 @@ script = ExtResource("1_p0ukn")
[node name="Asteroid" type="Sprite2D" parent="."]
texture = ExtResource("1_u87q6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
light_mask = 2
visibility_layer = 2
shape = SubResource("CircleShape2D_p0ukn")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PackedVector2Array(12, -1, 6, -6, 5, -13, -8, -12, -12, -5, -12, 4, -6, 13, -2, 10, 2, 14, 12, 3)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@@ -35,6 +35,8 @@ position = Vector2(320, 640)
shape = SubResource("RectangleShape2D_xxgf6")
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 3
collision_mask = 3
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(0, 320)
@@ -52,4 +54,4 @@ shape = SubResource("RectangleShape2D_xxgf6")
position = Vector2(320, 640)
shape = SubResource("RectangleShape2D_xxgf6")
[connection signal="body_entered" from="Area2D" to="." method="_body_entered_for_multiple"]
[connection signal="body_exited" from="Area2D" to="." method="_on_area_2d_body_exited"]