From 656c3278a46302a2dd3f9e0d560876a4d24e8ab7 Mon Sep 17 00:00:00 2001 From: Alan Youngblood Date: Sun, 17 Nov 2024 17:34:31 -0500 Subject: [PATCH] Enemy Death Effect Added --- Action RPG Resources/UI/TouchButtons.aseprite | Bin 0 -> 1461 bytes Action RPG Resources/UI/TouchButtons1.png | Bin 0 -> 263 bytes Action RPG Resources/UI/TouchButtons2.png | Bin 0 -> 261 bytes Action RPG Resources/UI/TouchButtons3.png | Bin 0 -> 262 bytes Action RPG Resources/UI/TouchButtons4.png | Bin 0 -> 260 bytes Action RPG Resources/UI/TouchButtons5.png | Bin 0 -> 278 bytes Action RPG Resources/UI/TouchButtons6.png | Bin 0 -> 265 bytes ActionRPG-HeartBeast/Effects/Effect.gd | 9 +++ .../Effects/EnemyDeathEffect.tscn | 58 ++++++++++++++++++ ActionRPG-HeartBeast/Effects/GrassEffect.gd | 10 --- ActionRPG-HeartBeast/Effects/GrassEffect.tscn | 26 ++++---- ActionRPG-HeartBeast/Enemies/Bat.gd | 5 ++ ActionRPG-HeartBeast/Player/Player.tscn | 8 +-- ActionRPG-HeartBeast/World/Grass.gd | 8 +-- ActionRPG-HeartBeast/build/.DS_Store | Bin 6148 -> 6148 bytes ActionRPG-HeartBeast/build/web/.DS_Store | Bin 6148 -> 6148 bytes 16 files changed, 91 insertions(+), 33 deletions(-) create mode 100644 Action RPG Resources/UI/TouchButtons.aseprite create mode 100644 Action RPG Resources/UI/TouchButtons1.png create mode 100644 Action RPG Resources/UI/TouchButtons2.png create mode 100644 Action RPG Resources/UI/TouchButtons3.png create mode 100644 Action RPG Resources/UI/TouchButtons4.png create mode 100644 Action RPG Resources/UI/TouchButtons5.png create mode 100644 Action RPG Resources/UI/TouchButtons6.png create mode 100644 ActionRPG-HeartBeast/Effects/Effect.gd create mode 100644 ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn delete mode 100644 ActionRPG-HeartBeast/Effects/GrassEffect.gd diff --git a/Action RPG Resources/UI/TouchButtons.aseprite b/Action RPG Resources/UI/TouchButtons.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..5742cbfcd22029605c286add06df8615d5b515fe GIT binary patch literal 1461 zcmdnW%E0hoDI0?X5OOduGB7Zt05JjxFff7y83cfk79a#@`mc{{U|ZRM7Ki~cy8_rs zBe-a8sR;gWQTu<9;n&~){~MP4S1XyKnB~lnuIyQwvF^(L|26`b zN*O9^PO!|lgxKq>E`jZPyC=iH}Qj$`;W_? zA0Bn!`Mg-Z=MKMunAb(?f&jiSul*Y~J(?f0v!3U+E7(Ftpl4Yb5Ek+?@G?})Nlsv3 ztYb?#aK8W4WA~>Y7k_%dFtwfULdwOji)Q!a>F-)S;SLYO{|BrVhk=It`p5(hQ;?(S z?h7ZVFIX9vk$l0+zz_EY%Y*07-O~?4h1uV_?G) z4+#km*csV076`V>ODcSx@Kj<#NRn|c<4oQsQ1_ohbAJKYI3NK8h{OphIS{!aq4WR$ z$8H^AEpm5XU5w*6qVw^9)H`j9)49=_WzF7uPh9vS%=Z71B%6Loi@mLU9M2I0`(Fo7 z{AEa5D6*HC{b|C|FWlPN|4y>zvT?@v0qtQ0mIbURnSmFa8K#~wrVqsL(Ub%_(tH||ND11 zE_Pj59Bq4xyK#o9T*Tp8*7TjZ+DG#WR*Fl`syp-`-sF$nMpaTODn zs%KNWrXu*iMeYAZhF^dG|8H3GU#(<{VwN*Qy0T|!#=0x}|Jw*$DrKmc$)FLbq5S?a zP_IBqkY6yve^hWFpxYTJm+9%^7@{$;bdsSEgCYlW?i!6x|L@=HgTe~DWM4faCB-! literal 0 HcmV?d00001 diff --git a/Action RPG Resources/UI/TouchButtons2.png b/Action RPG Resources/UI/TouchButtons2.png new file mode 100644 index 0000000000000000000000000000000000000000..d8044c760a41f043a1a9d6948c34889f1ff7b364 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAF%}28J29*~C-V}>F$nMpaTODn zs%KNWrXu*iMeYAZhF^dG|8H3GU#(<{VwN*Qy0T|!#=0x}|Jw*$DrKmc$)FLbq5S?a zP_IBqkY6yve^hWFpxYTJm+tA}7@{$8?Idfy0}4FOkye!-{^mz(PMF_mb(Q;4wW9`S zc4bDS)TfOdMQcv2{?4dn|NVj5P6@U9&pM8+PJEo^qropM`{Z#wS523}*3WN}g|4r; ukp7f$!DHSSv8HLe4lP=@w!h+so&KFC0->+xG%N#J$>8bg=d#Wzp$P!KZ*I5% literal 0 HcmV?d00001 diff --git a/Action RPG Resources/UI/TouchButtons3.png b/Action RPG Resources/UI/TouchButtons3.png new file mode 100644 index 0000000000000000000000000000000000000000..6572fd73f81a2347972b9a5226d7f8c8bc6fbfd4 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAF%}28J29*~C-V}>F$nMpaTODn zs%KNWrXu*iMeYAZhF^dG|8H3GU#(<{VwN*Qy0T|!#=0x}|Jw*$DrKmc$)FLbq5S?a zP_IBqkY6yve^hWFpxYTJm*MH+7@{$8>Lg2{0}4FMnK3Ib{I8dGN>Y*+3EXL2QDe~7 zuC3g@W$F@{bkz#BH#-mZPUBR&BEGP7g&OCs1ha6n|;J&zddEl;FxviEL&L+;+ v*zL4=HGBE%)=!xNi_}Fz*WG*c>~~C4gFxuxd$&#k?PTzD^>bP0l+XkKUAk?B literal 0 HcmV?d00001 diff --git a/Action RPG Resources/UI/TouchButtons4.png b/Action RPG Resources/UI/TouchButtons4.png new file mode 100644 index 0000000000000000000000000000000000000000..4dfc73ab886c034bce55acd90409f0ea3ca5e8e8 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAF%}28J29*~C-V}>F$nMpaTODn zs%KNWrXu*iMeYAZhF^dG|8H3GU#(<{VwN*Qy0T|!#=0x}|Jw*$DrKmc$)FLbq5S?a zP_IBqkY6yve^hWFpxYTJm*(l>7@{$8>m^H}1_K`FK=XAWKmKi3mB`mv=<>Aw@Bx*M zCuh`cjK2z|rb$)umc8o|d8NzwFO>OJW77ov7v?5A{_tdM*vVejskbcuBFm(AC1DKP t9>>aV)^}ui_5JFiZFhee%Gb^3zBF0D|2p^I3qTtgJYD@<);T3K0RZ=DY#RUo literal 0 HcmV?d00001 diff --git a/Action RPG Resources/UI/TouchButtons5.png b/Action RPG Resources/UI/TouchButtons5.png new file mode 100644 index 0000000000000000000000000000000000000000..079c8aa6b8612763eb7d0b2fae8e59260461b30a GIT binary patch literal 278 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAF%}28J29*~C-V}>F$nMpaTODn zs%KNWrXu*iMeYAZhF^dG|8H3GU#(<{VwN*Qy0T|!#=0x}|Jw*$DrKmc$)FLbq5S?a zP_IBqkY6yve^hWFpxYTJSK;a67@{#TcakF?gCYmBF8j~_{o;w8teKCN3Lk9BUiu&^ z_CT5Glrr~}*&>_wn|A&bm^fV~!QINDbpbPHKu7Znn+ZH&9F6l878!9oTAy*i^A~G` z>`~UITzlH@$y6%u(stGVnh}<|?bKskGhLVNiq@8SYx}=_sI|M#z|r-W!J-7{1_n=8 KKbLh*2~7ZKG;d4* literal 0 HcmV?d00001 diff --git a/Action RPG Resources/UI/TouchButtons6.png b/Action RPG Resources/UI/TouchButtons6.png new file mode 100644 index 0000000000000000000000000000000000000000..13fb748e87f0c2f6ac71ffd5c526f1f0e0df3455 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAF%}28J29*~C-V}>F$nMpaTODn zs%KNWrXu*iMeYAZhF^dG|8H3GU#(<{VwN*Qy0T|!#=0x}|Jw*$DrKmc$)FLbq5S?a zP_IBqkY6yve^hWFpxYTJm+k4|7@{$;cakID0R;}0lZXD_kMU;KIkB+X$T(0$r1OBX zaYJPrmyPH{;iKn#5A(#Sov!jK@nf62|CsB?FY_5cM{Hd2{jYfB+YbVPCgw5MmF!xV x3S0^7J-=*q-rLY;$1}M5CtNZ8Dyo0~Ib-I3)&w2dLMx!P44$rjF6*2UngGE(Y~la_ literal 0 HcmV?d00001 diff --git a/ActionRPG-HeartBeast/Effects/Effect.gd b/ActionRPG-HeartBeast/Effects/Effect.gd new file mode 100644 index 0000000..ad6d0f8 --- /dev/null +++ b/ActionRPG-HeartBeast/Effects/Effect.gd @@ -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() diff --git a/ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn b/ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn new file mode 100644 index 0000000..e94917a --- /dev/null +++ b/ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn @@ -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 ) diff --git a/ActionRPG-HeartBeast/Effects/GrassEffect.gd b/ActionRPG-HeartBeast/Effects/GrassEffect.gd deleted file mode 100644 index 03525a4..0000000 --- a/ActionRPG-HeartBeast/Effects/GrassEffect.gd +++ /dev/null @@ -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() diff --git a/ActionRPG-HeartBeast/Effects/GrassEffect.tscn b/ActionRPG-HeartBeast/Effects/GrassEffect.tscn index f8cb10c..a9d5214 100644 --- a/ActionRPG-HeartBeast/Effects/GrassEffect.tscn +++ b/ActionRPG-HeartBeast/Effects/GrassEffect.tscn @@ -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 ) diff --git a/ActionRPG-HeartBeast/Enemies/Bat.gd b/ActionRPG-HeartBeast/Enemies/Bat.gd index c527f65..10b93a2 100644 --- a/ActionRPG-HeartBeast/Enemies/Bat.gd +++ b/ActionRPG-HeartBeast/Enemies/Bat.gd @@ -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 diff --git a/ActionRPG-HeartBeast/Player/Player.tscn b/ActionRPG-HeartBeast/Player/Player.tscn index 374adbb..dbe99f3 100644 --- a/ActionRPG-HeartBeast/Player/Player.tscn +++ b/ActionRPG-HeartBeast/Player/Player.tscn @@ -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 ) diff --git a/ActionRPG-HeartBeast/World/Grass.gd b/ActionRPG-HeartBeast/World/Grass.gd index 4320b28..9290c5a 100644 --- a/ActionRPG-HeartBeast/World/Grass.gd +++ b/ActionRPG-HeartBeast/World/Grass.gd @@ -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): diff --git a/ActionRPG-HeartBeast/build/.DS_Store b/ActionRPG-HeartBeast/build/.DS_Store index 73cb3e413eacc1fa42159ca125c01920536fe1e0..72dc846f2a64855649e26c02eb611e197290d5a7 100644 GIT binary patch delta 96 zcmZoMXffE}&ce8JvIk3{hh%lNiK&H-f}x2~t&T#qp^=5Dj)H}$X>Bbhhp4i?bx?eE gPHtX)HvF9QRE#AE>$X+vEG7Y0`bA0Q3^Vm*c`hD?S6&z$_^q@4UD dpeg|%UeCb5`0hU#FfeT9VOh<*nVsV=KL8%j7N7tC