Skip to content

Commit

Permalink
🎶 Main theme
Browse files Browse the repository at this point in the history
  • Loading branch information
heytherewill committed Oct 1, 2023
1 parent 9f38454 commit fd9f682
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 3 deletions.
Binary file added aseprite/audio_button.aseprite
Binary file not shown.
Binary file modified aseprite/health.aseprite
Binary file not shown.
Binary file added assets/audio/dungeon_banger.wav
Binary file not shown.
23 changes: 23 additions & 0 deletions assets/audio/dungeon_banger.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/dungeon_banger.wav-ae3221417c6e7b6951de54cac48944e9.sample"

[deps]

source_file="res://assets/audio/dungeon_banger.wav"
dest_files=[ "res://.import/dungeon_banger.wav-ae3221417c6e7b6951de54cac48944e9.sample" ]

[params]

force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
7 changes: 7 additions & 0 deletions scenes/main/TopHud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ public sealed class TopHud : Control
{
private const int maxWidth = 58;

public override void _Ready()
{

var audioButton = GetNode<TextureRect>("AudioButton");
// TODO: Handle clicks here????
}

public void UpdateHealth(int newHealth, int maxHealth)
{
var healthFill = GetNode<NinePatchRect>("HealthFill");
Expand Down
99 changes: 97 additions & 2 deletions scenes/main/TopHud.tscn
Original file line number Diff line number Diff line change
@@ -1,15 +1,84 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=17 format=2]

[ext_resource path="res://assets/images/health_fill.png" type="Texture" id=1]
[ext_resource path="res://assets/images/backpack.png" type="Texture" id=2]
[ext_resource path="res://assets/images/health.png" type="Texture" id=3]
[ext_resource path="res://assets/Minimal4.tres" type="DynamicFont" id=4]
[ext_resource path="res://scenes/main/TopHud.cs" type="Script" id=5]
[ext_resource path="res://scenes/main/audio_button.png" type="Texture" id=6]
[ext_resource path="res://assets/audio/dungeon_banger.wav" type="AudioStream" id=7]

[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 6 )
region = Rect2( 0, 0, 16, 16 )
filter_clip = true

[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 6 )
region = Rect2( 16, 0, 16, 16 )
filter_clip = true

[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 6 )
region = Rect2( 32, 0, 16, 16 )
filter_clip = true

[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 6 )
region = Rect2( 0, 16, 16, 16 )
filter_clip = true

[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 6 )
region = Rect2( 16, 16, 16, 16 )
filter_clip = true

[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 6 )
region = Rect2( 32, 16, 16, 16 )
filter_clip = true

[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 6 )
region = Rect2( 0, 32, 16, 16 )
filter_clip = true

[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 6 )
region = Rect2( 16, 32, 16, 16 )
filter_clip = true

[sub_resource type="Animation" id=9]
length = 0.8
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = false
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:texture")
tracks/1/interp = 1
tracks/1/loop_wrap = false
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ]
}

[node name="TopHud" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = -116.0
margin_bottom = -91.0
script = ExtResource( 5 )

Expand Down Expand Up @@ -52,3 +121,29 @@ __meta__ = {
"source": "res://aseprite/backpack.aseprite"
}
}

[node name="AudioButton" type="TextureRect" parent="."]
margin_left = 158.0
margin_right = 174.0
margin_bottom = 16.0
texture = SubResource( 1 )
__meta__ = {
"_aseprite_wizard_config_": {
"layer": "",
"o_ex_p": "",
"o_folder": "",
"o_name": "",
"only_visible": false,
"op_exp": false,
"player": "AudioButton/AnimationPlayer",
"source": "res://aseprite/audio_button.aseprite"
}
}

[node name="AnimationPlayer" type="AnimationPlayer" parent="AudioButton"]
anims/default = SubResource( 9 )

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="AudioButton"]
stream = ExtResource( 7 )
pitch_scale = 1.01
autoplay = true
Binary file added scenes/main/audio_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions scenes/main/audio_button.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/audio_button.png-def04ca39aadc8f181990c51f5c840bc.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://scenes/main/audio_button.png"
dest_files=[ "res://.import/audio_button.png-def04ca39aadc8f181990c51f5c840bc.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
1 change: 0 additions & 1 deletion scenes/main/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@ script = ExtResource( 7 )

[connection signal="RoomExited" from="Room" to="." method="onRoomExited"]
[connection signal="HealthChanged" from="Player" to="." method="onPlayerHealthChanged"]
[connection signal="DialogueFinished" from="Dialogue" to="." method="onDialogueFinished"]

0 comments on commit fd9f682

Please sign in to comment.