-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from DOGamedev5/main
adding room3 and audioManager system
- Loading branch information
Showing
22 changed files
with
264 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
extends Node | ||
|
||
onready var musics := { | ||
"temple in ruins" : preload("res://audio/musics/templeInRuins.mp3") | ||
} | ||
onready var sfxs := { | ||
|
||
} | ||
|
||
|
||
onready var musicPlayer := $musicPlayer | ||
|
||
var currentMusic : String | ||
|
||
func playMusic(music : String): | ||
if music == currentMusic: | ||
return | ||
|
||
if musicPlayer.playing: | ||
stop() | ||
|
||
_setMusic(music) | ||
|
||
func _setMusic(music : String): | ||
musicPlayer.stream = musics[music] | ||
currentMusic = music | ||
musicPlayer.playing = true | ||
|
||
func stop(): | ||
musicPlayer.playing = false | ||
|
||
func playSFX(SFX : String, positional := false, position = Vector2.ZERO, distance = .0, maskArea = 0): | ||
var newSfx | ||
if positional: | ||
newSfx = AudioStreamPlayer2D.new() | ||
newSfx.position = position | ||
newSfx.max_distance = distance | ||
newSfx.area_mask = maskArea | ||
else: | ||
newSfx = AudioStreamPlayer.new() | ||
|
||
newSfx.stream = sfxs[SFX] | ||
newSfx.set_bus("SFX") | ||
newSfx.connect("finished", newSfx, "queue_free") | ||
|
||
get_tree().current_scene.add_child(newSfx) | ||
newSfx.play() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[gd_scene load_steps=4 format=2] | ||
|
||
[ext_resource path="res://audio/audioSystem/audioSystem.gd" type="Script" id=1] | ||
|
||
[sub_resource type="Animation" id=1] | ||
length = 0.001 | ||
tracks/0/type = "bezier" | ||
tracks/0/path = NodePath("musicPlayer:volume_db") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/keys = { | ||
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0 ), | ||
"times": PoolRealArray( 0 ) | ||
} | ||
|
||
[sub_resource type="Animation" id=2] | ||
resource_name = "fade-in" | ||
tracks/0/type = "bezier" | ||
tracks/0/path = NodePath("musicPlayer:volume_db") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/keys = { | ||
"points": PoolRealArray( 0, -0.25, 0, 0.3, -79.25, -100, -0.3, 30.75, 0.25, 0 ), | ||
"times": PoolRealArray( 0, 0.6 ) | ||
} | ||
|
||
[node name="Audio" type="Node"] | ||
script = ExtResource( 1 ) | ||
|
||
[node name="musicPlayer" type="AudioStreamPlayer" parent="."] | ||
|
||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] | ||
anims/RESET = SubResource( 1 ) | ||
anims/fade-in = SubResource( 2 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[gd_resource type="AudioBusLayout" format=2] | ||
|
||
[resource] | ||
bus/0/volume_db = -12.1201 | ||
bus/1/name = "music" | ||
bus/1/solo = false | ||
bus/1/mute = false | ||
bus/1/bypass_fx = false | ||
bus/1/volume_db = 0.0 | ||
bus/1/send = "Master" | ||
bus/2/name = "SFX" | ||
bus/2/solo = false | ||
bus/2/mute = false | ||
bus/2/bypass_fx = false | ||
bus/2/volume_db = 0.0 | ||
bus/2/send = "Master" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[remap] | ||
|
||
importer="mp3" | ||
type="AudioStreamMP3" | ||
path="res://.import/templeInRuins.mp3-9f8c17b60e483fa8ca2894963b564134.mp3str" | ||
|
||
[deps] | ||
|
||
source_file="res://audio/musics/templeInRuins.mp3" | ||
dest_files=[ "res://.import/templeInRuins.mp3-9f8c17b60e483fa8ca2894963b564134.mp3str" ] | ||
|
||
[params] | ||
|
||
loop=true | ||
loop_offset=0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[remap] | ||
|
||
importer="com.technohacker.pixelorama" | ||
type="StreamTexture" | ||
path="res://.import/effect1.pxo-e14b83f33bc5af2dbff6a39023222ec2.stex" | ||
|
||
[deps] | ||
|
||
source_file="res://gameplay/effects/effect1.pxo" | ||
dest_files=[ "res://.import/effect1.pxo-e14b83f33bc5af2dbff6a39023222ec2.stex" ] | ||
|
||
[params] | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.