spider implementation! death_blood_offset variable added to enemy.gd to facilitate
This commit is contained in:
parent
b1beffd97b
commit
bc4510a103
6 changed files with 128 additions and 3 deletions
51
objects/enemy/spider.tscn
Normal file
51
objects/enemy/spider.tscn
Normal file
|
@ -0,0 +1,51 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/enemy/spider.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/enemy/spider.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 15, 14 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 15, 0, 15, 14 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=3]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 7.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=4]
|
||||
extents = Vector2( 4.5, 4 )
|
||||
|
||||
[node name="Spider" type="Node2D" groups=["enemy"]]
|
||||
script = ExtResource( 2 )
|
||||
speed = 30.0
|
||||
|
||||
[node name="Line2D" type="Line2D" parent="."]
|
||||
position = Vector2( 4.5, 0 )
|
||||
points = PoolVector2Array( 0, 0, 0, 0 )
|
||||
width = 1.0
|
||||
default_color = Color( 1, 1, 1, 1 )
|
||||
|
||||
[node name="RayCast2D" type="RayCast2D" parent="."]
|
||||
position = Vector2( 4.5, 4 )
|
||||
cast_to = Vector2( 0, -192 )
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
|
||||
position = Vector2( 5, 5 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="Hitbox"]
|
||||
frames = SubResource( 3 )
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( -0.5, -1 )
|
||||
shape = SubResource( 4 )
|
||||
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
Loading…
Add table
Add a link
Reference in a new issue