Merge branch 'main' of community.rokojori.com:eggnot/first_anniversary_godot_jam into main

# Conflicts:
#	3d_platforma/Level1_platforms_slow.tscn
This commit is contained in:
ruinthread-games 2024-06-15 16:23:13 +02:00
commit 05a4b84df6
15 changed files with 398 additions and 84 deletions

View File

@ -1,14 +1,20 @@
[gd_scene load_steps=13 format=2]
[gd_scene load_steps=24 format=2]
[ext_resource path="res://3d_platforma/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://3d_platforma/golden_bay_512.hdr" type="Texture" id=2]
[ext_resource path="res://Music/slow track.wav" type="AudioStream" id=2]
[ext_resource path="res://scripts/Library/Actions/Snare Admiral 2.wav" type="AudioStream" id=3]
[ext_resource path="res://3d_platforma/Level1_platforms_slow.tscn" type="PackedScene" id=4]
[ext_resource path="res://3d_platforma/sqare_norm.png" type="Texture" id=4]
[ext_resource path="res://3d_platforma/texture_08.png" type="Texture" id=5]
[ext_resource path="res://scripts/Library/Actions/TriggerOnReady.gd" type="Script" id=6]
[ext_resource path="res://scripts/Library/Actions/ActionList.gd" type="Script" id=7]
[ext_resource path="res://scripts/Library/Actions/SFX BlackTiger.wav" type="AudioStream" id=8]
[ext_resource path="res://Tape/Tape.tscn" type="PackedScene" id=9]
[ext_resource path="res://Tape/TapeFast.tscn" type="PackedScene" id=9]
[ext_resource path="res://Tape/TapeNormal.tscn" type="PackedScene" id=10]
[ext_resource path="res://Tape/TapeSlow.tscn" type="PackedScene" id=11]
[ext_resource path="res://scripts/RegisterAudioStreamPlayerSlow.gd" type="Script" id=12]
[ext_resource path="res://scripts/RegisterAudioStreamPlayerFast.gd" type="Script" id=13]
[ext_resource path="res://scripts/RegisterAudioStreamPlayerNormal.gd" type="Script" id=14]
[ext_resource path="res://Music/godot-project-hiphop.wav" type="AudioStream" id=15]
[sub_resource type="SpatialMaterial" id=36]
resource_name = "CheckerGrid"
@ -17,13 +23,66 @@ albedo_texture = ExtResource( 5 )
roughness = 0.85
uv1_triplanar = true
[sub_resource type="PanoramaSky" id=23]
panorama = ExtResource( 2 )
[sub_resource type="SpatialMaterial" id=38]
resource_name = "CheckerGrid"
albedo_color = Color( 0.85, 0.85, 0.85, 1 )
albedo_texture = ExtResource( 5 )
roughness = 0.85
uv1_triplanar = true
[sub_resource type="OpenSimplexNoise" id=28]
octaves = 2
period = 0.8
[sub_resource type="NoiseTexture" id=29]
flags = 3
width = 32
height = 32
noise = SubResource( 28 )
[sub_resource type="SpatialMaterial" id=22]
albedo_color = Color( 0.478431, 0.235294, 0.486275, 1 )
roughness = 0.5
roughness_texture = SubResource( 29 )
normal_enabled = true
normal_scale = 1.0
normal_texture = ExtResource( 4 )
uv1_scale = Vector3( 3, 3, 3 )
uv1_triplanar = true
[sub_resource type="Animation" id=37]
resource_name = "move"
length = 30.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:translation:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 10, 30 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ 0.0, 10.0, 0.0 ]
}
[sub_resource type="ProceduralSky" id=39]
sky_top_color = Color( 0.0901961, 0.121569, 0.141176, 1 )
sky_horizon_color = Color( 0.266667, 0.301961, 0.333333, 1 )
sky_energy = 0.1
ground_bottom_color = Color( 0.160784, 0.0666667, 0.0352941, 1 )
ground_horizon_color = Color( 0.266667, 0.301961, 0.333333, 1 )
ground_energy = 0.1
sun_color = Color( 0.972549, 0.976471, 0.345098, 1 )
sun_latitude = 15.0
sun_longitude = -3.96
sun_curve = 0.0170755
[sub_resource type="Environment" id=24]
resource_name = "black_env"
background_mode = 2
background_sky = SubResource( 23 )
background_sky = SubResource( 39 )
background_sky_custom_fov = 50.0
background_color = Color( 0.137255, 0.137255, 0.137255, 1 )
background_energy = 2.0
@ -46,19 +105,119 @@ glow_hdr_scale = 4.0
[node name="Game" type="Spatial"]
[node name="start" type="CSGBox" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.1, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -24.1, 0 )
use_collision = true
width = 6.05148
height = 0.2
depth = 6.62613
width = 4.0
height = 48.0
depth = 6.0
material = SubResource( 36 )
[node name="Player" parent="." instance=ExtResource( 1 )]
[node name="platforms_slow" parent="." instance=ExtResource( 4 )]
[node name="enviroment" type="Spatial" parent="."]
[node name="Ring2" type="CSGPolygon" parent="enviroment"]
transform = Transform( 0.866025, 0.5, -2.18557e-08, 0, -4.37114e-08, -1, -0.5, 0.866025, -3.78552e-08, -1, 3.6, -18.4713 )
polygon = PoolVector2Array( 9, -2, 9.4, -1, 10, -1, 10, -2 )
mode = 1
spin_degrees = 360.0
spin_sides = 16
material = SubResource( 38 )
[node name="Ring3" type="CSGPolygon" parent="enviroment"]
transform = Transform( 0.866025, 0.5, -2.18557e-08, 0, -4.37114e-08, -1, -0.5, 0.866025, -3.78552e-08, -7, 6.6, -28.4713 )
polygon = PoolVector2Array( 13, -4, 14, -2, 15, -2, 15, -4 )
mode = 1
spin_degrees = 360.0
spin_sides = 16
material = SubResource( 38 )
[node name="platforms_slow" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, -4.4 )
[node name="pickup" type="CSGCylinder" parent="platforms_slow"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.3, -2 )
use_collision = true
radius = 2.3
height = 0.2
sides = 11
[node name="Ring" type="CSGPolygon" parent="platforms_slow"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.7, -8.07128 )
use_collision = true
polygon = PoolVector2Array( 6.5, 0.1, 6.4, 1, 7, 1, 7, 0 )
mode = 1
spin_degrees = 360.0
spin_sides = 16
material = SubResource( 38 )
[node name="ramp2" type="CSGBox" parent="platforms_slow"]
transform = Transform( 1, 0, 0, 0, 0.984808, -0.173648, 0, 0.173648, 0.984808, 0, -1.2, -7.7 )
use_collision = true
width = 2.4
height = 0.4
depth = 4.0
material = SubResource( 22 )
[node name="slow_path" type="CSGBox" parent="platforms_slow"]
transform = Transform( 0.965926, 0, 0.258819, 0, 1, 0, -0.258819, 0, 0.965926, 0, -0.7, -11.4713 )
use_collision = true
width = 2.2
height = 0.6
material = SubResource( 22 )
[node name="slow_path2" type="CSGBox" parent="platforms_slow"]
transform = Transform( 0.866025, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866025, -1.4, -0.4, -14.3713 )
use_collision = true
width = 2.2
height = 0.6
material = SubResource( 22 )
[node name="slow_path3" type="CSGBox" parent="platforms_slow"]
transform = Transform( 0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, -2.6, 0.6, -16.3713 )
use_collision = true
width = 2.2
height = 0.6
material = SubResource( 22 )
[node name="slow_path4" type="CSGBox" parent="platforms_slow"]
transform = Transform( 0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, -4.3, 1.6, -18.5713 )
use_collision = true
width = 2.2
height = 0.6
material = SubResource( 22 )
[node name="slow_path5" type="CSGBox" parent="platforms_slow"]
transform = Transform( 0.866026, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866026, -6.3, 2.6, -21.5713 )
use_collision = true
width = 2.2
height = 0.6
material = SubResource( 22 )
[node name="slow_path6" type="CSGBox" parent="platforms_slow"]
transform = Transform( 0.965926, 0, 0.258819, 0, 1, 0, -0.258819, 0, 0.965926, -7.3, 3.6, -24.5713 )
use_collision = true
width = 2.2
height = 0.6
material = SubResource( 22 )
[node name="lift" type="Spatial" parent="platforms_slow"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 8, -0.4, -16 )
visible = false
[node name="platform" type="CSGBox" parent="platforms_slow/lift"]
use_collision = true
width = 4.0
height = 1.0
depth = 4.0
material = SubResource( 38 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="platforms_slow/lift/platform"]
autoplay = "move"
anims/move = SubResource( 37 )
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 5, 0 )
transform = Transform( 0.707107, -0.5, 0.5, 0.00134521, 0.708057, 0.706154, -0.707106, -0.498654, 0.501344, 0, 5, 0 )
light_energy = 0.65
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
@ -83,5 +242,22 @@ script = ExtResource( 1 )
[node name="PlaySound2" type="Node" parent="ActionList"]
script = ExtResource( 1 )
[node name="Tape" parent="." instance=ExtResource( 9 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.1894 )
[node name="TapeFast" parent="." instance=ExtResource( 9 )]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -1.34058, 0.785612, -1.25926 )
[node name="TapeNormal" parent="." instance=ExtResource( 10 )]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0.518271, 0.785612, -1.35086 )
[node name="TapeSlow" parent="." instance=ExtResource( 11 )]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -0.06, 0.7, -6.3138 )
[node name="AudioStreamPlayer3DSlow" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource( 2 )
script = ExtResource( 12 )
[node name="AudioStreamPlayer3DNormal" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource( 15 )
script = ExtResource( 14 )
[node name="AudioStreamPlayer3DFast" type="AudioStreamPlayer3D" parent="."]
script = ExtResource( 13 )

View File

@ -1,16 +1,36 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://3d_platforma/texture_08.png" type="Texture" id=1]
[ext_resource path="res://3d_platforma/sqare_norm.png" type="Texture" id=2]
[sub_resource type="SpatialMaterial" id=1]
[sub_resource type="SpatialMaterial" id=36]
resource_name = "CheckerGrid"
albedo_color = Color( 0.85, 0.85, 0.85, 1 )
albedo_texture = ExtResource( 1 )
roughness = 0.85
uv1_triplanar = true
[sub_resource type="Animation" id=2]
[sub_resource type="OpenSimplexNoise" id=28]
octaves = 2
period = 0.8
[sub_resource type="NoiseTexture" id=29]
flags = 3
width = 32
height = 32
noise = SubResource( 28 )
[sub_resource type="SpatialMaterial" id=22]
albedo_color = Color( 0.478431, 0.235294, 0.486275, 1 )
roughness = 0.5
roughness_texture = SubResource( 29 )
normal_enabled = true
normal_scale = 1.0
normal_texture = ExtResource( 2 )
uv1_scale = Vector3( 3, 3, 3 )
uv1_triplanar = true
[sub_resource type="Animation" id=37]
resource_name = "move"
length = 30.0
loop = true
@ -27,81 +47,52 @@ tracks/0/keys = {
"values": [ 0.0, 10.0, 0.0 ]
}
[sub_resource type="BoxShape" id=3]
[sub_resource type="CubeMesh" id=4]
[sub_resource type="OpenSimplexNoise" id=5]
octaves = 2
period = 0.8
[sub_resource type="NoiseTexture" id=6]
flags = 3
width = 32
height = 32
noise = SubResource( 5 )
[sub_resource type="SpatialMaterial" id=7]
albedo_color = Color( 0.603922, 0.0235294, 0.619608, 1 )
roughness = 0.25
roughness_texture = SubResource( 6 )
normal_enabled = true
normal_scale = 1.0
normal_texture = ExtResource( 2 )
uv1_scale = Vector3( 3, 3, 3 )
uv1_triplanar = true
[node name="platforms_slow" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.1, 0 )
[node name="thin" type="CSGBox" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, -12 )
[node name="Ring" type="CSGPolygon" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1, -2.37128 )
use_collision = true
width = 4.0
height = 0.2
depth = 10.0
material = SubResource( 1 )
polygon = PoolVector2Array( 3, 0, 3.37031, 1.2588, 4.15364, 1.29316, 4, 0 )
mode = 1
spin_degrees = 360.0
spin_sides = 16
material = SubResource( 36 )
[node name="ramp" type="CSGBox" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.4, -22 )
[node name="ramp2" type="CSGBox" parent="."]
transform = Transform( 1, 0, 0, 0, 0.984808, -0.173648, 0, 0.173648, 0.984808, 0, -0.9, -2 )
use_collision = true
width = 4.0
height = 1.0
depth = 10.0
material = SubResource( 1 )
width = 2.4
height = 0.4
depth = 4.0
material = SubResource( 22 )
[node name="pickup" type="CSGBox" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, -15.5713 )
use_collision = true
width = 2.2
height = 0.6
depth = 4.0
material = SubResource( 22 )
[node name="lift" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.4, -30 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 8, -0.4, -16 )
visible = false
[node name="platform" type="CSGBox" parent="lift"]
use_collision = true
width = 4.0
height = 1.0
depth = 4.0
material = SubResource( 1 )
material = SubResource( 36 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="lift/platform"]
autoplay = "move"
anims/move = SubResource( 2 )
anims/move = SubResource( 37 )
[node name="lego" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5, -1.9, -8 )
__meta__ = {
"_edit_group_": true
}
[node name="CollisionShape" type="CollisionShape" parent="lego"]
shape = SubResource( 3 )
[node name="MeshInstance" type="MeshInstance" parent="lego"]
mesh = SubResource( 4 )
material/0 = SubResource( 7 )
[node name="CSGPolygon" type="CSGPolygon" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1, -12 )
[node name="CSGCylinder" type="CSGCylinder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -7 )
use_collision = true
polygon = PoolVector2Array( 3, -4, 3, 1, 4.15364, 1.29316, 4, -4 )
mode = 1
spin_degrees = 360.0
spin_sides = 16
material = SubResource( 1 )
radius = 2.0
height = 0.2
sides = 11

View File

@ -0,0 +1,6 @@
[gd_resource type="PanoramaSky" load_steps=2 format=2]
[ext_resource path="res://3d_platforma/golden_bay_512.hdr" type="Texture" id=1]
[resource]
panorama = ExtResource( 1 )

Binary file not shown.

BIN
Music/slow track.wav Normal file

Binary file not shown.

27
Tape/TapeFast.tscn Normal file
View File

@ -0,0 +1,27 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://scripts/SetFastMusic.gd" type="Script" id=1]
[ext_resource path="res://Tape/tape.obj" type="ArrayMesh" id=2]
[ext_resource path="res://scripts/Library/Actions/TriggerOnCollision.gd" type="Script" id=3]
[sub_resource type="BoxShape" id=1]
[node name="TapeFast" type="Spatial"]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 )
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = ExtResource( 2 )
[node name="Area" type="Area" parent="."]
[node name="CollisionShape" type="CollisionShape" parent="Area"]
transform = Transform( 0.240864, 0, 0, 0, 1, 0, 0, 0, 1.66505, 0, 0, 0 )
shape = SubResource( 1 )
[node name="TriggerOnCollision" type="Node" parent="Area"]
script = ExtResource( 3 )
collision_area = NodePath("..")
action = NodePath("../SetFastMusic")
[node name="SetFastMusic" type="Node" parent="Area"]
script = ExtResource( 1 )

27
Tape/TapeNormal.tscn Normal file
View File

@ -0,0 +1,27 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://scripts/SetNormalMusic.gd" type="Script" id=1]
[ext_resource path="res://Tape/tape.obj" type="ArrayMesh" id=2]
[ext_resource path="res://scripts/Library/Actions/TriggerOnCollision.gd" type="Script" id=3]
[sub_resource type="BoxShape" id=1]
[node name="TapeNormal" type="Spatial"]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 )
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = ExtResource( 2 )
[node name="Area" type="Area" parent="."]
[node name="CollisionShape" type="CollisionShape" parent="Area"]
transform = Transform( 0.240864, 0, 0, 0, 1, 0, 0, 0, 1.66505, 0, 0, 0 )
shape = SubResource( 1 )
[node name="TriggerOnCollision" type="Node" parent="Area"]
script = ExtResource( 3 )
collision_area = NodePath("..")
action = NodePath("../SetNormalMusic")
[node name="SetNormalMusic" type="Node" parent="Area"]
script = ExtResource( 1 )

View File

@ -2,11 +2,12 @@
[ext_resource path="res://Tape/tape.obj" type="ArrayMesh" id=1]
[ext_resource path="res://scripts/Library/Actions/TriggerOnCollision.gd" type="Script" id=2]
[ext_resource path="res://scripts/Library/Actions/PlaySound.gd" type="Script" id=3]
[ext_resource path="res://scripts/SetSlowMusic.gd" type="Script" id=3]
[sub_resource type="BoxShape" id=1]
[node name="Tape" type="Spatial"]
[node name="TapeSlow" type="Spatial"]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 )
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = ExtResource( 1 )
@ -20,7 +21,7 @@ shape = SubResource( 1 )
[node name="TriggerOnCollision" type="Node" parent="Area"]
script = ExtResource( 2 )
collision_area = NodePath("..")
action = NodePath("../PlaySound")
action = NodePath("../SetSlowMusic")
[node name="PlaySound" type="Node" parent="Area"]
[node name="SetSlowMusic" type="Node" parent="Area"]
script = ExtResource( 3 )

View File

@ -19,6 +19,11 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://scripts/Library/Actions/ActionList.gd"
}, {
"base": "Node",
"class": "MusicChangedSlowAction",
"language": "GDScript",
"path": "res://scripts/Library/Actions/MusicChangedSlowAction.gd"
}, {
"base": "Action",
"class": "PlaySound",
"language": "GDScript",
@ -57,6 +62,7 @@ _global_script_classes=[ {
_global_script_class_icons={
"Action": "",
"ActionList": "",
"MusicChangedSlowAction": "",
"PlaySound": "",
"SetFastMusic": "",
"SetNormalMusic": "",
@ -91,6 +97,12 @@ common/drop_mouse_on_gui_input_disabled=true
[input]
ui_end={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
move_forward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":87,"unicode":0,"echo":false,"script":null)

View File

@ -0,0 +1,10 @@
class_name MusicChangedSlowAction extends Node
func _ready():
MusicSingleton.register_change_action(self)
func _exit_tree():
MusicSingleton.unregister_change_action(self)
func execute() -> void:
print("Executed OnMusicChangedSlowAction")

View File

@ -8,6 +8,5 @@ func _ready():
func onTrigger():
print("OnTrigger PlaySound")
# get_node( audioStreamPlayer ).play()
get_node( audioStreamPlayer ).play()

View File

@ -6,6 +6,10 @@ func _ready() -> void:
var change_slow_actions : Array = []
var gameSpeed : float = 1;
var musicType: int = 0;
var audio_player_slow : AudioStreamPlayer3D
var audio_player_normal : AudioStreamPlayer3D
var audio_player_fast : AudioStreamPlayer3D
var current_audio_player : AudioStreamPlayer3D
func setSlowMusic():
setMusicType( -1 )
@ -17,16 +21,49 @@ func setNormalMusic():
setMusicType( 0 )
func setMusicType( type:int ):
print("Set Music type")
musicType = type;
gameSpeed = 0
if type == 0:
gameSpeed = 0
var current_playback_position : float = 0.0
print("Set Music type normal")
if current_audio_player:
current_playback_position = current_audio_player.get_playback_position()
current_audio_player.stop()
current_audio_player = audio_player_normal
current_audio_player.play(current_playback_position)
if type == 1:
gameSpeed = 2
var current_playback_position : float = 0.0
if current_audio_player:
current_playback_position = current_audio_player.get_playback_position()
current_audio_player.stop()
current_audio_player = audio_player_fast
current_audio_player.play(current_playback_position)
if type == -1:
print("Set Music type slow")
gameSpeed = 0.5
var current_playback_position : float = 0.0
if current_audio_player:
current_playback_position = current_audio_player.get_playback_position()
current_audio_player.stop()
current_audio_player = audio_player_slow
current_audio_player.play(current_playback_position)
func register_change_action(change_action : Node) -> void:
print("Registered change action")
@ -39,3 +76,16 @@ func unregister_change_action(change_action : Node) -> void:
func change_music() -> void:
for change_action in change_slow_actions:
change_action.execute()
func register_audio_player_slow(audio_player : AudioStreamPlayer3D) -> void:
print("Registered audio stream player fast")
audio_player_slow = audio_player
func register_audio_player_normal(audio_player : AudioStreamPlayer3D) -> void:
print("Registered audio stream player normal")
audio_player_normal = audio_player
func register_audio_player_fast(audio_player : AudioStreamPlayer3D) -> void:
print("Registered audio stream player fast")
audio_player_fast = audio_player

View File

@ -0,0 +1,5 @@
extends AudioStreamPlayer3D
func _ready():
MusicSingleton.register_audio_player_fast(self)

View File

@ -0,0 +1,5 @@
extends AudioStreamPlayer3D
func _ready():
MusicSingleton.register_audio_player_normal(self)

View File

@ -0,0 +1,5 @@
extends AudioStreamPlayer3D
func _ready():
MusicSingleton.register_audio_player_slow(self)