From 7cead8f3848dd50c3158b5aeaf5dbcd58dffd8c9 Mon Sep 17 00:00:00 2001 From: Just Dzhi Date: Mon, 2 Oct 2023 21:00:00 +0400 Subject: [PATCH] Dead sound & spell icon --- project.godot | 1 + res/themes/default.tres | 1 + src/scenes/game/Game.tscn | 16 +++--- src/scenes/game/spell_holder.gd | 4 ++ src/scripts/global.gd | 1 + src/sounds/AudioDead.tscn | 6 +++ src/spell_icons/SpellIcon.tscn | 7 +++ src/spell_icons/spell_icons.png | Bin 0 -> 764 bytes src/spell_icons/spell_icons.png.import | 35 ++++++++++++ src/spell_icons/spell_icons_spriteframes.tres | 51 ++++++++++++++++++ 10 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 src/sounds/AudioDead.tscn create mode 100644 src/spell_icons/SpellIcon.tscn create mode 100644 src/spell_icons/spell_icons.png create mode 100644 src/spell_icons/spell_icons.png.import create mode 100644 src/spell_icons/spell_icons_spriteframes.tres diff --git a/project.godot b/project.godot index 59a010b..fc3552e 100644 --- a/project.godot +++ b/project.godot @@ -21,6 +21,7 @@ config/icon="res://icon.png" Global="*res://src/scripts/global.gd" Window="*res://src/scripts/window.gd" Music="*res://src/music/Music.tscn" +AudioDead="*res://src/sounds/AudioDead.tscn" [display] diff --git a/res/themes/default.tres b/res/themes/default.tres index f806a20..41f81a2 100644 --- a/res/themes/default.tres +++ b/res/themes/default.tres @@ -3,6 +3,7 @@ [ext_resource path="res://res/fonts/silkscreen/Silkscreen-Regular.ttf" type="DynamicFontData" id=1] [sub_resource type="DynamicFont" id=1] +size = 8 font_data = ExtResource( 1 ) [resource] diff --git a/src/scenes/game/Game.tscn b/src/scenes/game/Game.tscn index 230dede..a93d4a0 100644 --- a/src/scenes/game/Game.tscn +++ b/src/scenes/game/Game.tscn @@ -32,14 +32,14 @@ extents = Vector2( 140, 10.125 ) atlas = ExtResource( 6 ) region = Rect2( 155, 0, 31, 11 ) -[sub_resource type="AtlasTexture" id=8] -atlas = ExtResource( 6 ) -region = Rect2( 124, 0, 31, 11 ) - [sub_resource type="AtlasTexture" id=9] atlas = ExtResource( 6 ) region = Rect2( 93, 0, 31, 11 ) +[sub_resource type="AtlasTexture" id=8] +atlas = ExtResource( 6 ) +region = Rect2( 124, 0, 31, 11 ) + [sub_resource type="AtlasTexture" id=10] atlas = ExtResource( 6 ) region = Rect2( 62, 0, 31, 11 ) @@ -54,10 +54,10 @@ region = Rect2( 0, 0, 31, 11 ) [sub_resource type="SpriteFrames" id=4] animations = [ { -"frames": [ SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ], -"loop": true, -"name": "default", -"speed": 5.0 +"frames": [ SubResource( 7 ), SubResource( 9 ), SubResource( 8 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ], +"loop": false, +"name": "idle", +"speed": 0.0 } ] [sub_resource type="Animation" id=5] diff --git a/src/scenes/game/spell_holder.gd b/src/scenes/game/spell_holder.gd index 95b8628..fab916d 100644 --- a/src/scenes/game/spell_holder.gd +++ b/src/scenes/game/spell_holder.gd @@ -1,9 +1,13 @@ extends Control var cell_preload = preload("res://src/models/spell_cell/SpellCell.tscn") +var modifiers = [] func _ready(): for i in range(5): var spell_cell = cell_preload.instance() spell_cell.rect_position.x += i * (14 + 2) self.add_child(spell_cell) + +func add_modifier(spell_name): + modifiers.append(spell_name) diff --git a/src/scripts/global.gd b/src/scripts/global.gd index 8ba297b..f97d291 100644 --- a/src/scripts/global.gd +++ b/src/scripts/global.gd @@ -19,6 +19,7 @@ func add_health(amount): get_tree().get_root().get_node("Game/UIWrapper/UI/Left/Health/HealthSprite").frame = health if health == 0: playing = false + AudioDead.play() get_tree().get_root().get_node("Game/View/Enemies").free() var animplayer = get_tree().get_root().get_node("Game/UIWrapper/UI/Gameover/AnimationPlayer") animplayer.play("gameover") diff --git a/src/sounds/AudioDead.tscn b/src/sounds/AudioDead.tscn new file mode 100644 index 0000000..0542632 --- /dev/null +++ b/src/sounds/AudioDead.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://res/sounds/player/dead.wav" type="AudioStream" id=1] + +[node name="AudioDead" type="AudioStreamPlayer"] +stream = ExtResource( 1 ) diff --git a/src/spell_icons/SpellIcon.tscn b/src/spell_icons/SpellIcon.tscn new file mode 100644 index 0000000..a837345 --- /dev/null +++ b/src/spell_icons/SpellIcon.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/spell_icons/spell_icons_spriteframes.tres" type="SpriteFrames" id=1] + +[node name="SpellIcon" type="AnimatedSprite"] +frames = ExtResource( 1 ) +animation = "idle" diff --git a/src/spell_icons/spell_icons.png b/src/spell_icons/spell_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..219f37aa45619779447e0a304940934c9266de96 GIT binary patch literal 764 zcmVPx%wn;=mR9J=WS37RoKoETsxK*wo=nyUh5MT%a>U07%R>2hNcmhMY08=T23#su5 z(kU<`0}2!%hcJ{Y=m3*~JImQ0#lnCC#INCUc6K@YX83j&c*mQ9q`}PHjzm$vBCGs? zv_IDAF)zdzG1)di7`6Q}=6``*?VNw}BfdvhKgWz8>6QSO%p$9Jf2^G`CLy#x)~N)z zlaIKujlu%BEXHhNWB@eSoN!r;`Q!Fiv~V7t8^1EQ?*PDM4)S9eE~gBD&g)(9-QjY| zf4=<))+^ZFg8|@f)$*4rP!qcbY5yCs3i)%)l8Mj|@{6o;?8e4LR=IOXwfkri!gwKy zBtiT0Wih7c9I)iucA2++l9<@sCK0|pxqcyE+Byjl#J=m;KKLVaB2u&Zm4BGje3;a{ zKh`L+3Z^fbc@>1N`ha{>{r>naoh0Q$QvK*A)RJ*t??~CA(Bya7{JFh3opl5W5cK>D zaG2Em>8TA%#H#H1Qqeli3GQWEDh$WJ8vdko9giS{+a<$N-Xv9HwBsB@S9M6f4oHrig66$B0mVVyW}KQE zWe(COA?;V@AYX!p%PC96i{vQj3BF@wC;0Z=3Y6+YJPDM1>4QEOF=-rrer?CJ#5Wf) u_d?e6MD7AH=*!x*3#32hU-N&*8{;pQOlhw=ag1>Q0000