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 0000000..219f37a Binary files /dev/null and b/src/spell_icons/spell_icons.png differ diff --git a/src/spell_icons/spell_icons.png.import b/src/spell_icons/spell_icons.png.import new file mode 100644 index 0000000..caee4fe --- /dev/null +++ b/src/spell_icons/spell_icons.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/spell_icons.png-476a1a6f1751c8bab148cb7884c4b7b5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/spell_icons/spell_icons.png" +dest_files=[ "res://.import/spell_icons.png-476a1a6f1751c8bab148cb7884c4b7b5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/spell_icons/spell_icons_spriteframes.tres b/src/spell_icons/spell_icons_spriteframes.tres new file mode 100644 index 0000000..2219cc9 --- /dev/null +++ b/src/spell_icons/spell_icons_spriteframes.tres @@ -0,0 +1,51 @@ +[gd_resource type="SpriteFrames" load_steps=10 format=2] + +[ext_resource path="res://src/spell_icons/spell_icons.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 12, 12 ) + +[sub_resource type="AtlasTexture" id=2] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 12, 0, 12, 12 ) + +[sub_resource type="AtlasTexture" id=3] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 24, 0, 12, 12 ) + +[sub_resource type="AtlasTexture" id=4] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 36, 0, 12, 12 ) + +[sub_resource type="AtlasTexture" id=5] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 48, 0, 12, 12 ) + +[sub_resource type="AtlasTexture" id=6] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 60, 0, 12, 12 ) + +[sub_resource type="AtlasTexture" id=7] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 72, 0, 12, 12 ) + +[sub_resource type="AtlasTexture" id=8] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 84, 0, 12, 12 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ], +"loop": false, +"name": "idle", +"speed": 0.0 +} ]