Atmosphere tracks
This commit is contained in:
parent
5a7cc35613
commit
020b995c94
6 changed files with 64 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
BIN
sounds/ballad_of_the_cats.mp3
Normal file
BIN
sounds/ballad_of_the_cats.mp3
Normal file
Binary file not shown.
19
sounds/ballad_of_the_cats.mp3.import
Normal file
19
sounds/ballad_of_the_cats.mp3.import
Normal file
|
|
@ -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
|
||||
BIN
sounds/concrete_halls.mp3
Normal file
BIN
sounds/concrete_halls.mp3
Normal file
Binary file not shown.
19
sounds/concrete_halls.mp3.import
Normal file
19
sounds/concrete_halls.mp3.import
Normal file
|
|
@ -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
|
||||
Loading…
Reference in a new issue