Enemy Death Effect Added
This commit is contained in:
parent
6555ebe4c2
commit
656c3278a4
BIN
Action RPG Resources/UI/TouchButtons.aseprite
Normal file
BIN
Action RPG Resources/UI/TouchButtons.aseprite
Normal file
Binary file not shown.
BIN
Action RPG Resources/UI/TouchButtons1.png
Normal file
BIN
Action RPG Resources/UI/TouchButtons1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 263 B |
BIN
Action RPG Resources/UI/TouchButtons2.png
Normal file
BIN
Action RPG Resources/UI/TouchButtons2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 261 B |
BIN
Action RPG Resources/UI/TouchButtons3.png
Normal file
BIN
Action RPG Resources/UI/TouchButtons3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 262 B |
BIN
Action RPG Resources/UI/TouchButtons4.png
Normal file
BIN
Action RPG Resources/UI/TouchButtons4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 260 B |
BIN
Action RPG Resources/UI/TouchButtons5.png
Normal file
BIN
Action RPG Resources/UI/TouchButtons5.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 278 B |
BIN
Action RPG Resources/UI/TouchButtons6.png
Normal file
BIN
Action RPG Resources/UI/TouchButtons6.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 265 B |
9
ActionRPG-HeartBeast/Effects/Effect.gd
Normal file
9
ActionRPG-HeartBeast/Effects/Effect.gd
Normal file
@ -0,0 +1,9 @@
|
||||
extends AnimatedSprite
|
||||
|
||||
func _ready():
|
||||
connect("animation_finished", self, "_on_animation_finished")
|
||||
frame = 0
|
||||
play("Animate")
|
||||
|
||||
func _on_animation_finished():
|
||||
queue_free()
|
58
ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn
Normal file
58
ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn
Normal file
@ -0,0 +1,58 @@
|
||||
[gd_scene load_steps=14 format=2]
|
||||
|
||||
[ext_resource path="res://Effects/Effect.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Effects/EnemyDeathEffect.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 0, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 32, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 64, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 96, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 128, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 160, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 192, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 224, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=9]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 256, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=10]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 288, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=11]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ],
|
||||
"loop": true,
|
||||
"name": "Animation",
|
||||
"speed": 15.0
|
||||
} ]
|
||||
|
||||
[node name="EnemyDeathEffect" type="AnimatedSprite"]
|
||||
frames = SubResource( 11 )
|
||||
animation = "Animation"
|
||||
offset = Vector2( 0, -8 )
|
||||
script = ExtResource( 1 )
|
@ -1,10 +0,0 @@
|
||||
extends Node2D
|
||||
|
||||
onready var animatedSprite = $AnimatedSprite
|
||||
|
||||
func _ready():
|
||||
animatedSprite.frame = 0
|
||||
animatedSprite.play("Animate")
|
||||
|
||||
func _on_AnimatedSprite_animation_finished():
|
||||
queue_free()
|
@ -1,43 +1,39 @@
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://Effects/GrassEffect.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Effects/GrassEffect.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Effects/GrassEffect.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Effects/Effect.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 2 )
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 2 )
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 32, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 2 )
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 64, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 2 )
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 96, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 2 )
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 128, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=6]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
|
||||
"loop": false,
|
||||
"loop": true,
|
||||
"name": "Animate",
|
||||
"speed": 15.0
|
||||
} ]
|
||||
|
||||
[node name="GrassEffect" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
[node name="GrassEffect" type="AnimatedSprite"]
|
||||
frames = SubResource( 6 )
|
||||
animation = "Animate"
|
||||
frame = 4
|
||||
centered = false
|
||||
|
||||
[connection signal="animation_finished" from="AnimatedSprite" to="." method="_on_AnimatedSprite_animation_finished"]
|
||||
offset = Vector2( -8, -8 )
|
||||
script = ExtResource( 2 )
|
||||
|
@ -1,5 +1,7 @@
|
||||
extends KinematicBody2D
|
||||
|
||||
const EnemyDeathEffect = preload("res://Effects/EnemyDeathEffect.tscn")
|
||||
|
||||
var knockback = Vector2.ZERO
|
||||
|
||||
onready var stats = $Stats
|
||||
@ -15,3 +17,6 @@ func _on_Hurtbox_area_entered(area):
|
||||
|
||||
func _on_Stats_no_health():
|
||||
queue_free()
|
||||
var enemyDeathEffect = EnemyDeathEffect.instance()
|
||||
get_parent().add_child(enemyDeathEffect)
|
||||
enemyDeathEffect.global_position = global_position
|
||||
|
@ -677,10 +677,10 @@ anims/RunUp = SubResource( 5 )
|
||||
tree_root = SubResource( 18 )
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
parameters/playback = SubResource( 19 )
|
||||
parameters/Attack/blend_position = Vector2( 0, 0 )
|
||||
parameters/Idle/blend_position = Vector2( 0, 0 )
|
||||
parameters/Roll/blend_position = Vector2( -0.00132686, 0.00234544 )
|
||||
parameters/Run/blend_position = Vector2( 0, 0 )
|
||||
parameters/Attack/blend_position = Vector2( 0, 1 )
|
||||
parameters/Idle/blend_position = Vector2( 0, 1 )
|
||||
parameters/Roll/blend_position = Vector2( 0, 1 )
|
||||
parameters/Run/blend_position = Vector2( 0, 1 )
|
||||
|
||||
[node name="HitboxPivot" type="Position2D" parent="."]
|
||||
position = Vector2( 0, -4 )
|
||||
|
@ -1,16 +1,16 @@
|
||||
extends Node2D
|
||||
|
||||
|
||||
const GrassEffect = preload("res://Effects/GrassEffect.tscn")
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func create_grass_effect():
|
||||
var GrassEffect = load("res://Effects/GrassEffect.tscn")
|
||||
#var GrassEffect = load("res://Effects/GrassEffect.tscn")
|
||||
var grassEffect = GrassEffect.instance()
|
||||
var world = get_tree().current_scene
|
||||
world.add_child(grassEffect)
|
||||
# var world = get_tree().current_scene
|
||||
get_parent().add_child(grassEffect)
|
||||
grassEffect.global_position = global_position
|
||||
|
||||
func _on_Hurtbox_area_entered(area):
|
||||
|
BIN
ActionRPG-HeartBeast/build/.DS_Store
vendored
BIN
ActionRPG-HeartBeast/build/.DS_Store
vendored
Binary file not shown.
BIN
ActionRPG-HeartBeast/build/web/.DS_Store
vendored
BIN
ActionRPG-HeartBeast/build/web/.DS_Store
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user