diff --git a/scenes/game.tscn b/scenes/game.tscn index 0958b0c..398cf93 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=9 format=3 uid="uid://bauklhpieuivd"] +[gd_scene load_steps=11 format=3 uid="uid://bauklhpieuivd"] [ext_resource type="Script" uid="uid://d0qswyhwbhdua" path="res://scripts/game.gd" id="1_u5sy4"] [ext_resource type="Texture2D" uid="uid://dtwo7g0ipc4k" path="res://textures/ship_1.png" id="1_uwrxv"] [ext_resource type="Script" uid="uid://bfxfkrkaebxk0" path="res://scripts/player.gd" id="1_yqjtg"] +[ext_resource type="AudioStream" uid="uid://bfvnxahiyqxhx" path="res://sounds/ballad_of_the_cats.mp3" id="2_gee14"] [ext_resource type="AudioStream" uid="uid://brqjxveo53kco" path="res://sounds/boost.mp3" id="2_iywne"] [ext_resource type="AudioStream" uid="uid://5tr30e1tmdp6" path="res://sounds/collision.mp3" id="2_lbhrr"] +[ext_resource type="AudioStream" uid="uid://b6tyof2j3ytbv" path="res://sounds/concrete_halls.mp3" id="3_0tnpc"] [ext_resource type="AudioStream" uid="uid://b1ung55xg31l3" path="res://sounds/boost_finish.mp3" id="3_p57ef"] [sub_resource type="CircleShape2D" id="CircleShape2D_uwrxv"] @@ -16,6 +18,14 @@ radius = 20.0 [node name="Game" type="Node2D"] script = ExtResource("1_u5sy4") +[node name="BalladOfTheCats" type="AudioStreamPlayer" parent="."] +stream = ExtResource("2_gee14") +volume_db = -10.0 + +[node name="ConcreteHalls" type="AudioStreamPlayer" parent="."] +stream = ExtResource("3_0tnpc") +volume_db = -10.0 + [node name="Player" type="RigidBody2D" parent="."] linear_damp = 6.247 script = ExtResource("1_yqjtg") @@ -25,6 +35,7 @@ stream = ExtResource("2_iywne") [node name="BoostFinish" type="AudioStreamPlayer" parent="Player"] stream = ExtResource("3_p57ef") +volume_db = -8.0 [node name="Collision" type="AudioStreamPlayer" parent="Player"] stream = ExtResource("2_lbhrr") diff --git a/scripts/game.gd b/scripts/game.gd index db0f563..e3a2ab5 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -3,6 +3,8 @@ extends Node2D var chunk_tick_timer = 0 var chunks = {} var chunk_process_distance = 6 +var time_since_last_atmospheric_track = 999 +var current_atmospheric_track = null var asteroid_scene = preload("res://scenes/asteroid.tscn") @@ -16,6 +18,18 @@ func _process(delta: float) -> void: $UI/Control/BoostText.text = "BOOST: " + str($Player.boost) $UI/Control/Distance.text = "DIST: " + str(floori($Player.position.length())) + if current_atmospheric_track: + if not current_atmospheric_track.playing: + time_since_last_atmospheric_track = 0 + else: + time_since_last_atmospheric_track += delta + + if time_since_last_atmospheric_track > 60: + var tracks = [$BalladOfTheCats, $ConcreteHalls] + + current_atmospheric_track = tracks[randi_range(0, tracks.size())] + current_atmospheric_track.play() + chunk_tick_timer -= delta if chunk_tick_timer < 0: diff --git a/sounds/ballad_of_the_cats.mp3 b/sounds/ballad_of_the_cats.mp3 new file mode 100644 index 0000000..68256bb Binary files /dev/null and b/sounds/ballad_of_the_cats.mp3 differ diff --git a/sounds/ballad_of_the_cats.mp3.import b/sounds/ballad_of_the_cats.mp3.import new file mode 100644 index 0000000..8df431a --- /dev/null +++ b/sounds/ballad_of_the_cats.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://bfvnxahiyqxhx" +path="res://.godot/imported/ballad_of_the_cats.mp3-21e2f7a824ec17ab4242e1eeae355193.mp3str" + +[deps] + +source_file="res://sounds/ballad_of_the_cats.mp3" +dest_files=["res://.godot/imported/ballad_of_the_cats.mp3-21e2f7a824ec17ab4242e1eeae355193.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/sounds/concrete_halls.mp3 b/sounds/concrete_halls.mp3 new file mode 100644 index 0000000..107205f Binary files /dev/null and b/sounds/concrete_halls.mp3 differ diff --git a/sounds/concrete_halls.mp3.import b/sounds/concrete_halls.mp3.import new file mode 100644 index 0000000..bc6a74a --- /dev/null +++ b/sounds/concrete_halls.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://b6tyof2j3ytbv" +path="res://.godot/imported/concrete_halls.mp3-7815a3a2687d60c1be039c7b1a674765.mp3str" + +[deps] + +source_file="res://sounds/concrete_halls.mp3" +dest_files=["res://.godot/imported/concrete_halls.mp3-7815a3a2687d60c1be039c7b1a674765.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4