Skip to content

Commit

Permalink
Add musicPlayer node
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanLovato committed Oct 11, 2018
1 parent 2da4cbe commit ac5a398
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
15 changes: 3 additions & 12 deletions Demo.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[gd_scene load_steps=11 format=2]

[ext_resource path="res://Game.gd" type="Script" id=1]
[ext_resource path="res://audio/music/birdy_pong.ogg" type="AudioStream" id=2]
[ext_resource path="res://audio/MusicPlayer.tscn" type="PackedScene" id=2]
[ext_resource path="res://Level.gd" type="Script" id=3]
[ext_resource path="res://actors/player/Player.tscn" type="PackedScene" id=4]
[ext_resource path="res://vfx/TransitionColor.tscn" type="PackedScene" id=5]
Expand All @@ -17,23 +17,14 @@ pause_mode = 2
script = ExtResource( 1 )
_sections_unfolded = [ "Pause" ]

[node name="MusicPlayer" type="AudioStreamPlayer" parent="." index="0"]

pause_mode = 2
stream = ExtResource( 2 )
volume_db = 0.0
pitch_scale = 1.0
autoplay = false
mix_target = 0
bus = "Music"
_sections_unfolded = [ "Pause" ]
[node name="MusicPlayer" parent="." index="0" instance=ExtResource( 2 )]

[node name="Level" type="Node" parent="." index="1"]

pause_mode = 1
script = ExtResource( 3 )
_sections_unfolded = [ "Pause" ]
LEVEL_START = "res://world/levels/Cave.tscn"
LEVEL_START = "res://world/levels/TestLevel.tscn"

[node name="Player" parent="Level" index="0" instance=ExtResource( 4 )]

Expand Down
4 changes: 4 additions & 0 deletions audio/MusicPlayer.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends AudioStreamPlayer

func _ready():
play()
16 changes: 16 additions & 0 deletions audio/MusicPlayer.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://audio/music/birdy_pong.ogg" type="AudioStream" id=1]

[node name="MusicPlayer" type="AudioStreamPlayer"]

pause_mode = 2
stream = ExtResource( 1 )
volume_db = 0.0
pitch_scale = 1.0
autoplay = false
mix_target = 0
bus = "Music"
_sections_unfolded = [ "Pause" ]


16 changes: 12 additions & 4 deletions world/levels/TestLevel.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,26 @@ position = Vector2( 1162, 801 )

[node name="Coins" parent="." index="8" instance=ExtResource( 9 )]

position = Vector2( 648, 1031 )
position = Vector2( 858, 1149 )
MAX_START_VERTICAL_THRUST = 800.0
GRAVITY = 2000.0

[node name="Coins2" parent="." index="9" instance=ExtResource( 9 )]

position = Vector2( 852, 1171 )
position = Vector2( 934, 1253 )
MAX_START_VERTICAL_THRUST = 800.0
GRAVITY = 2000.0

[node name="Coins3" parent="." index="10" instance=ExtResource( 9 )]

position = Vector2( 936, 1319 )
position = Vector2( 650, 1005 )
MAX_START_VERTICAL_THRUST = 800.0
GRAVITY = 2000.0

[node name="Coins4" parent="." index="11" instance=ExtResource( 9 )]

position = Vector2( 988, 1051 )
position = Vector2( 534, 1105 )
MAX_START_VERTICAL_THRUST = 800.0
GRAVITY = 2000.0


0 comments on commit ac5a398

Please sign in to comment.