chore: Engine Update

This commit is contained in:
2023-11-27 10:38:02 +03:00
parent a7ba6a4354
commit 08f981fa2b
4 changed files with 20 additions and 6 deletions

View File

@@ -25,6 +25,7 @@
<ItemGroup>
<ProjectReference Include="..\Engine\Engine.Core\Engine.Core.csproj" />
<ProjectReference Include="..\Engine\Engine.Input\Engine.Input.csproj" />
<ProjectReference Include="..\Engine\Engine.Graphics\Engine.Graphics.csproj" />
</ItemGroup>
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
<Message Text="Restoring dotnet tools" Importance="High" />

View File

@@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Input;
using Pong.Behaviours;
using Syntriax.Engine.Core;
using Syntriax.Engine.Core.Abstract;
using Syntriax.Engine.Core.Behaviours;
using Syntriax.Engine.Graphics.TwoDimensional;
using Syntriax.Engine.Input;
namespace Pong;
@@ -40,8 +40,7 @@ public class Game1 : Game
_spriteBatch = new SpriteBatch(GraphicsDevice);
Texture2D texture2D = Content.Load<Texture2D>("Sprites/Pixel");
Sprite spriteRight = new Sprite() { Texture2D = texture2D, Color = Color.Gold };
Sprite spriteLeft = new Sprite() { Texture2D = texture2D, Color = Color.AliceBlue };
Sprite sprite = new Sprite() { Texture2D = texture2D };
gameObjectLeft = gameManager.InstantiateGameObject<GameObject>();
gameObjectLeft.Name = "Left";
@@ -49,7 +48,7 @@ public class Game1 : Game
gameObjectLeft.Transform.Scale = new Vector2(Window.ClientBounds.Width * .02f, Window.ClientBounds.Height * .15f);
gameObjectLeft.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
gameObjectLeft.BehaviourController.AddBehaviour<MovementBehaviour>(Keys.S, Keys.W, 200f);
gameObjectLeft.BehaviourController.AddBehaviour<DrawableSpriteBehaviour>().Assign(spriteLeft);
gameObjectLeft.BehaviourController.AddBehaviour<DisplayableSpriteBehaviour>(Color.Gold, null, null, null).Assign(sprite);
gameObjectRight = gameManager.InstantiateGameObject<GameObject>();
gameObjectRight.Name = "Right";
@@ -57,7 +56,7 @@ public class Game1 : Game
gameObjectRight.Transform.Scale = new Vector2(Window.ClientBounds.Width * .02f, Window.ClientBounds.Height * .15f);
gameObjectRight.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
gameObjectRight.BehaviourController.AddBehaviour<MovementBehaviour>(Keys.Down, Keys.Up, 200f);
gameObjectRight.BehaviourController.AddBehaviour<DrawableSpriteBehaviour>().Assign(spriteRight);
gameObjectRight.BehaviourController.AddBehaviour<DisplayableSpriteBehaviour>(Color.AliceBlue, null, null, null).Assign(sprite);
// TODO: use this.Content to load your game content here
}