Skip to content

Commit 5118872

Browse files
committed
Background music in handled by singleton GameState
1 parent 7206713 commit 5118872

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[gd_scene load_steps=2 format=2]
2+
3+
[ext_resource path="res://art/House In a Forest Loop.ogg" type="AudioStream" id=1]
4+
5+
[node name="GameState" type="Node"]
6+
7+
[node name="BGM" type="AudioStreamPlayer" parent="."]
8+
stream = ExtResource( 1 )
9+
autoplay = true

my-3d-squash-the-creeps/Main.tscn

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
[gd_scene load_steps=20 format=2]
1+
[gd_scene load_steps=19 format=2]
22

33
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
44
[ext_resource path="res://Main.gd" type="Script" id=2]
55
[ext_resource path="res://ui_theme.tres" type="Theme" id=3]
66
[ext_resource path="res://ScoreLabel.gd" type="Script" id=4]
7-
[ext_resource path="res://art/House In a Forest Loop.ogg" type="AudioStream" id=5]
87
[ext_resource path="res://default_env.tres" type="Environment" id=6]
98
[ext_resource path="res://ground_mesh.tres" type="CubeMesh" id=7]
109
[ext_resource path="res://Cyan.tres" type="Material" id=8]
@@ -225,10 +224,6 @@ margin_right = 224.0
225224
margin_bottom = 119.0
226225
text = "Exit"
227226

228-
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
229-
stream = ExtResource( 5 )
230-
autoplay = true
231-
232227
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
233228
environment = ExtResource( 6 )
234229

my-3d-squash-the-creeps/project.godot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ config/icon="res://icon.png"
2020
[autoload]
2121

2222
Hotkeys="*res://Hotkeys.gd"
23+
GameState="*res://GameState.tscn"
2324

2425
[display]
2526

0 commit comments

Comments
 (0)