diff --git a/Game/Behaviours/CameraController.cs b/Game/Behaviours/CameraController.cs index 3d3a8d3..2b9ee60 100644 --- a/Game/Behaviours/CameraController.cs +++ b/Game/Behaviours/CameraController.cs @@ -41,20 +41,20 @@ public class CameraController : BehaviourOverride private void SwitchToFullScreen(IButtonInputs inputs, Keys keys) { - if (Game1.graphics.IsFullScreen) + if (GamePong.graphics.IsFullScreen) return; - Game1.graphics.PreferMultiSampling = false; - Game1.graphics.PreferredBackBufferWidth = Game1.graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Width; - Game1.graphics.PreferredBackBufferHeight = Game1.graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Height; - Game1.graphics.IsFullScreen = true; - Game1.graphics.ApplyChanges(); + GamePong.graphics.PreferMultiSampling = false; + GamePong.graphics.PreferredBackBufferWidth = GamePong.graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Width; + GamePong.graphics.PreferredBackBufferHeight = GamePong.graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Height; + GamePong.graphics.IsFullScreen = true; + GamePong.graphics.ApplyChanges(); float previousScreenSize = Math.Sqrt(Math.Sqr(cameraBehaviour.Viewport.Width) + Math.Sqr(cameraBehaviour.Viewport.Height)); - float currentScreenSize = Math.Sqrt(Math.Sqr(Game1.graphics.GraphicsDevice.Viewport.Width) + Math.Sqr(Game1.graphics.GraphicsDevice.Viewport.Height)); + float currentScreenSize = Math.Sqrt(Math.Sqr(GamePong.graphics.GraphicsDevice.Viewport.Width) + Math.Sqr(GamePong.graphics.GraphicsDevice.Viewport.Height)); defaultZoomLevel /= previousScreenSize / currentScreenSize; cameraBehaviour.Zoom /= previousScreenSize / currentScreenSize; - cameraBehaviour.Viewport = Game1.graphics.GraphicsDevice.Viewport; + cameraBehaviour.Viewport = GamePong.graphics.GraphicsDevice.Viewport; } private void ResetCamera(IButtonInputs inputs, Keys keys) diff --git a/Game/Game1.cs b/Game/GamePong.cs similarity index 99% rename from Game/Game1.cs rename to Game/GamePong.cs index 4d84ac7..17a8b9e 100644 --- a/Game/Game1.cs +++ b/Game/GamePong.cs @@ -14,7 +14,7 @@ using Syntriax.Engine.Physics2D.Abstract; namespace Pong; -public class Game1 : Game +public class GamePong : Game { public static GraphicsDeviceManager graphics = null!; public static IPhysicsEngine2D engine = null!; @@ -25,7 +25,7 @@ public class Game1 : Game private MonoGameCameraBehaviour cameraBehaviour = null!; private PongManager pongManager; - public Game1() + public GamePong() { engine = new PhysicsEngine2D { diff --git a/Game/Program.cs b/Game/Program.cs index 33ccf4f..d379b45 100644 --- a/Game/Program.cs +++ b/Game/Program.cs @@ -1,3 +1,3 @@  -using var game = new Pong.Game1(); +using var game = new Pong.GamePong(); game.Run();