forked from team-sg/hero-mark-2
add mine that explodes on contact with player, shot by arrow, or other mine's explosions
This commit is contained in:
parent
c577f0a57c
commit
8a47c20d94
12 changed files with 338 additions and 7 deletions
101
objects/enemy/mine.tscn
Normal file
101
objects/enemy/mine.tscn
Normal file
|
@ -0,0 +1,101 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://objects/enemy/mine.gd" type="Script" id=1]
|
||||
[ext_resource path="res://graphics/enemy/mine.png" type="Texture" id=2]
|
||||
[ext_resource path="res://graphics/enemy/chain.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 8, 8 )
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Hitbox:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 8, 8 ) ]
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/path = NodePath("Hitbox:position:x")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"points": PoolRealArray( 8, -0.25, 0, 0.25, 0 ),
|
||||
"times": PoolRealArray( 0 )
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/path = NodePath("Hitbox:position:y")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"points": PoolRealArray( 8, -0.25, 0, 0.25, 0 ),
|
||||
"times": PoolRealArray( 0 )
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "sway"
|
||||
length = 8.0
|
||||
loop = true
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/path = NodePath("Hitbox:position:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"points": PoolRealArray( 4, -1.7, -0.0788159, 1.7, 0.0788159, 12, -1.9, -0.00271606, 1.9, 0.00271606, 4, -1.6, -0.0139103, 1.6, 0.0139103 ),
|
||||
"times": PoolRealArray( 0, 4, 8 )
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/path = NodePath("Hitbox:position:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"points": PoolRealArray( 8, -0.25, 0, 0.25, 0, 8, -0.25, 0, 0.25, 0, 8, -0.25, 0, 0.25, 0, 8, -0.25, 0, 0.25, 0, 8, -0.25, 0, 0.25, 0 ),
|
||||
"times": PoolRealArray( 0, 2, 4, 6, 8 )
|
||||
}
|
||||
|
||||
[node name="Mine" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
blood = false
|
||||
|
||||
[node name="GroundCast" type="RayCast2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2( 8, 8 )
|
||||
cast_to = Vector2( 0, 192 )
|
||||
|
||||
[node name="Chain" type="Line2D" parent="."]
|
||||
position = Vector2( 0, 8 )
|
||||
points = PoolVector2Array( 8, 0, 8, 16 )
|
||||
width = 4.0
|
||||
default_color = Color( 1, 1, 1, 1 )
|
||||
texture = ExtResource( 3 )
|
||||
texture_mode = 1
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
|
||||
position = Vector2( 8, 8 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Hitbox"]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
autoplay = "sway"
|
||||
anims/RESET = SubResource( 2 )
|
||||
anims/sway = SubResource( 3 )
|
||||
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
Loading…
Add table
Add a link
Reference in a new issue