new enemy work
This commit is contained in:
parent
783fc7c877
commit
6825cd59c9
12 changed files with 241 additions and 0 deletions
9
objects/enemies/belough/belough.gd
Normal file
9
objects/enemies/belough/belough.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
extends Enemy
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position.x += move_speed * delta
|
||||
if position.x > 340.0: position.x = -22.0
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
shoot()
|
||||
1
objects/enemies/belough/belough.gd.uid
Normal file
1
objects/enemies/belough/belough.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dn8flbhiqt6fv
|
||||
69
objects/enemies/belough/belough.tscn
Normal file
69
objects/enemies/belough/belough.tscn
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cbjv7fecdoet5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dn8flbhiqt6fv" path="res://objects/enemies/belough/belough.gd" id="1_u1v7t"]
|
||||
[ext_resource type="Texture2D" uid="uid://ecb1qd6euubm" path="res://assets/graphics/belough.png" id="2_62uax"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_nkf7n"]
|
||||
resource_name = "flap"
|
||||
length = 0.3
|
||||
loop_mode = 1
|
||||
step = 0.0333333
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:flip_v")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.0333333, 0.133333),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_qevrr"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:flip_v")
|
||||
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_xotlt"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_qevrr"),
|
||||
&"flap": SubResource("Animation_nkf7n")
|
||||
}
|
||||
|
||||
[node name="Belough" type="Node2D"]
|
||||
script = ExtResource("1_u1v7t")
|
||||
shoot_speed = Vector2(0, 100)
|
||||
shoot_variance = Vector2(0, 100)
|
||||
move_speed = 100.0
|
||||
metadata/_custom_type_script = "uid://d2k5tlvpqokqr"
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -5)
|
||||
texture = ExtResource("2_62uax")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_xotlt")
|
||||
}
|
||||
autoplay = "flap"
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
autostart = true
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(-5, -3)
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue