added coopa

This commit is contained in:
Jonas Braus
2024-08-03 00:57:40 +02:00
parent a706375da0
commit 1cd04a27cf
8 changed files with 322 additions and 32 deletions
+112
View File
@@ -0,0 +1,112 @@
[gd_scene load_steps=10 format=3 uid="uid://bkpny146y0y0e"]
[ext_resource type="Texture2D" uid="uid://ddl5f3lldrp2n" path="res://assets/enemies.png" id="1_451aa"]
[ext_resource type="Script" path="res://scripts/enemies/coopa.gd" id="1_iin32"]
[ext_resource type="AudioStream" uid="uid://bh8t167vl6j2n" path="res://assets/sounds/NES - Super Mario Bros - Sound Effects/Super Mario Bros 1 and 2(JP)/Kick.wav" id="2_e5ron"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ub6x3"]
atlas = ExtResource("1_451aa")
region = Rect2(150, 0, 16, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_dr5y8"]
atlas = ExtResource("1_451aa")
region = Rect2(180, 0, 16, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_hduks"]
atlas = ExtResource("1_451aa")
region = Rect2(360, 4, 16, 15)
[sub_resource type="SpriteFrames" id="SpriteFrames_g2x7m"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ub6x3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dr5y8")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_hduks")
}],
"loop": true,
"name": &"shrink",
"speed": 5.0
}]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ti4si"]
radius = 7.0
height = 24.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dpvp1"]
size = Vector2(10, 0.5)
[node name="coopa" type="RigidBody2D"]
collision_layer = 128
lock_rotation = true
script = ExtResource("1_iin32")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(8, -12)
sprite_frames = SubResource("SpriteFrames_g2x7m")
autoplay = "default"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(8, -12)
shape = SubResource("CapsuleShape2D_ti4si")
[node name="RayCastLeft" type="RayCast2D" parent="."]
position = Vector2(8, -8)
target_position = Vector2(-8, 0)
collision_mask = 17
[node name="RayCastLeft2" type="RayCast2D" parent="."]
position = Vector2(8, -8)
target_position = Vector2(-8, 0)
collision_mask = 2
[node name="RayCastLeft3" type="RayCast2D" parent="."]
position = Vector2(8, -8)
target_position = Vector2(-8, 0)
collision_mask = 128
[node name="RayCastRight" type="RayCast2D" parent="."]
position = Vector2(8, -8)
target_position = Vector2(8, 0)
collision_mask = 17
[node name="RayCastRight2" type="RayCast2D" parent="."]
position = Vector2(8, -8)
target_position = Vector2(8, 0)
collision_mask = 2
[node name="RayCastRight3" type="RayCast2D" parent="."]
position = Vector2(8, -8)
target_position = Vector2(8, 0)
collision_mask = 128
[node name="die" type="Area2D" parent="."]
position = Vector2(0, -8)
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="die"]
position = Vector2(8, -16.25)
shape = SubResource("RectangleShape2D_dpvp1")
[node name="dieSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("2_e5ron")
[node name="Timer2" type="Timer" parent="."]
one_shot = true
[node name="Timer" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[connection signal="body_entered" from="die" to="." method="_on_die_body_entered"]
[connection signal="timeout" from="Timer2" to="." method="_on_timer_2_timeout"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]