Made the music pause when you open the pause menu
This commit is contained in:
1 parent
c0b309c451
commit
64dcd6358b
3 files changed
+9
-1
No files matched your search
+1
-1
@@ -8,7 +8,7 @@ public partial class Globals : Node {
|
||||
|
||||
public static float MovementSpeed = 800f;
|
||||
public static float DefaultMovementSpeed = MovementSpeed;
|
||||
public static float JumpHeight = -1200f;
|
||||
public static float JumpHeight = -1100f;
|
||||
public static float DefaultJumpHeight = JumpHeight;
|
||||
public static float Gravity = 3000f;
|
||||
public static float DefaultGravity = JumpHeight;
|
||||
|
||||
@@ -3,6 +3,10 @@ using System;
|
||||
|
||||
public partial class PauseMenuContinueButton : Button {
|
||||
public void _on_button_up() {
|
||||
AudioStreamPlayer MusicPlayer = GetNode<AudioStreamPlayer>("/root/Game/MusicPlayer");
|
||||
|
||||
MusicPlayer.StreamPaused = !MusicPlayer.StreamPaused;
|
||||
|
||||
Globals.IsPaused = false;
|
||||
GetNode<Control>("../..").QueueFree();
|
||||
}
|
||||
|
||||
@@ -75,6 +75,10 @@ public partial class Player : Node2D {
|
||||
|
||||
GetNode<CanvasLayer>("/root/Game/CanvasLayer").AddChild(PauseMenuInstance);
|
||||
Globals.IsPaused = true;
|
||||
|
||||
AudioStreamPlayer MusicPlayer = GetNode<AudioStreamPlayer>("/root/Game/MusicPlayer");
|
||||
|
||||
MusicPlayer.StreamPaused = !MusicPlayer.StreamPaused;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user