bug fix && plants

This commit is contained in:
Jonas Braus
2024-08-03 10:52:53 +02:00
parent 4a64f30c57
commit 7ece2c1391
8 changed files with 159 additions and 21 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ animations = [{
"speed": 5.0
}]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ti4si"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_8406q"]
radius = 7.0
height = 24.0
@@ -57,7 +57,7 @@ autoplay = "default"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(8, -12)
shape = SubResource("CapsuleShape2D_ti4si")
shape = SubResource("CapsuleShape2D_8406q")
[node name="RayCastLeft" type="RayCast2D" parent="."]
position = Vector2(8, -8)
+87
View File
@@ -0,0 +1,87 @@
[gd_scene load_steps=10 format=3 uid="uid://dn2sy74ad2qfh"]
[ext_resource type="Script" path="res://scripts/enemies/plant.gd" id="1_7t6jh"]
[ext_resource type="Texture2D" uid="uid://ddl5f3lldrp2n" path="res://assets/enemies.png" id="1_jnxrw"]
[sub_resource type="AtlasTexture" id="AtlasTexture_cyktl"]
atlas = ExtResource("1_jnxrw")
region = Rect2(390, 30, 16, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_dylf8"]
atlas = ExtResource("1_jnxrw")
region = Rect2(420, 30, 16, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_th7fo"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_cyktl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dylf8")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mdpkr"]
size = Vector2(16, 24)
[sub_resource type="Animation" id="Animation_g0wcr"]
resource_name = "default"
length = 8.0
loop_mode = 1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(4, 8),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"move_up"
}, {
"args": [],
"method": &"move_down"
}]
}
[sub_resource type="Animation" id="Animation_axvvr"]
length = 0.001
[sub_resource type="AnimationLibrary" id="AnimationLibrary_x0mu6"]
_data = {
"RESET": SubResource("Animation_axvvr"),
"default": SubResource("Animation_g0wcr")
}
[node name="Plant" type="Area2D"]
collision_layer = 128
collision_mask = 2
script = ExtResource("1_7t6jh")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, 13)
sprite_frames = SubResource("SpriteFrames_th7fo")
autoplay = "default"
frame_progress = 0.459679
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 13)
shape = SubResource("RectangleShape2D_mdpkr")
[node name="Timer" type="Timer" parent="."]
one_shot = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_x0mu6")
}
autoplay = "default"
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
+15 -15
View File
@@ -6,6 +6,21 @@
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ihwdr"]
size = Vector2(6, 201)
[sub_resource type="Animation" id="Animation_ufkda"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AudioStreamPlayer:playing")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_ivwqs"]
resource_name = "change_scene"
length = 6.0
@@ -36,21 +51,6 @@ tracks/1/keys = {
"values": [true]
}
[sub_resource type="Animation" id="Animation_ufkda"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AudioStreamPlayer:playing")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_adywb"]
_data = {
"RESET": SubResource("Animation_ufkda"),
+1
View File
@@ -64,4 +64,5 @@ stream = ExtResource("3_270oi")
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
[connection signal="body_entered" from="CollCount" to="." method="_on_area_2d_body_entered"]
[connection signal="area_entered" from="EnemieDie" to="." method="_on_enemie_die_area_entered"]
[connection signal="body_entered" from="EnemieDie" to="." method="_on_enemie_die_body_entered"]
File diff suppressed because one or more lines are too long