From 0e922bb600597a6e319f5126a05bc754fbce9c2c Mon Sep 17 00:00:00 2001 From: Syntriax Date: Mon, 22 Jan 2024 11:21:27 +0300 Subject: [PATCH] refactor: Removed Unnecessary Lines --- Game/.vscode/settings.json | 7 +++++++ Game/Game1.cs | 11 ++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 Game/.vscode/settings.json diff --git a/Game/.vscode/settings.json b/Game/.vscode/settings.json new file mode 100644 index 0000000..f39a2ca --- /dev/null +++ b/Game/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "cSpell.words": [ + "AABB", + "DAABB", + "Syntriax" + ] +} diff --git a/Game/Game1.cs b/Game/Game1.cs index 7fa96c7..a1797ca 100644 --- a/Game/Game1.cs +++ b/Game/Game1.cs @@ -1,5 +1,5 @@ using System; -using System.Collections.Generic; + using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; @@ -9,7 +9,6 @@ using Pong.Behaviours; using Syntriax.Engine.Core; using Syntriax.Engine.Core.Abstract; using Syntriax.Engine.Graphics.TwoDimensional; -using Syntriax.Engine.Input; using Syntriax.Engine.Physics2D; using Syntriax.Engine.Physics2D.Primitives; @@ -25,6 +24,8 @@ public class Game1 : Game public Game1() { + engine = new PhysicsEngine2D(); + _graphics = new GraphicsDeviceManager(this) { PreferredBackBufferWidth = 1024, @@ -47,7 +48,6 @@ public class Game1 : Game protected override void LoadContent() { - engine = new PhysicsEngine2D(); _spriteBatch = new SpriteBatch(GraphicsDevice); spriteBox = new Sprite() { Texture2D = Content.Load("Sprites/Pixel") }; @@ -60,7 +60,7 @@ public class Game1 : Game gameManager.Camera = gameObjectCamera.BehaviourController.AddBehaviour(); gameManager.Camera.Viewport = GraphicsDevice.Viewport; - gameObjectBall = gameManager.InstantiateGameObject(); + GameObject gameObjectBall = gameManager.InstantiateGameObject(); gameObjectBall.Name = "Ball"; gameObjectBall.Transform.Position = Vector2.Zero; gameObjectBall.Transform.Scale = new Vector2(1f / 51.2f, 1f / 51.2f); @@ -171,7 +171,6 @@ public class Game1 : Game { physicsTimer += 0.01f; engine.Step(.01f); - Console.WriteLine($"{physicsTimer} -> {gameObjectBall.Transform.Position}"); } } if (Keyboard.GetState().IsKeyDown(Keys.M)) @@ -181,7 +180,6 @@ public class Game1 : Game { physicsTimer -= 0.01f; engine.Step(-.01f); - Console.WriteLine($"{physicsTimer} -> {gameObjectBall.Transform.Position}"); } } if (Keyboard.GetState().IsKeyDown(Keys.Space)) @@ -217,7 +215,6 @@ public class Game1 : Game } static float physicsTimer = 0f; static float seconds = 0f; - private GameObject gameObjectBall; protected override void Draw(GameTime gameTime) {