This commit is contained in:
Syntriax 2023-12-06 17:55:48 +03:00
parent add4783c73
commit 0fd1ebe726
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
@ -67,7 +67,7 @@ public class Game1 : Game
gameObjectBall.BehaviourController.AddBehaviour<MovementBallBehaviour>(new Vector2(.1f, .01f), 500f);
gameObjectBall.BehaviourController.AddBehaviour<DisplayableSpriteBehaviour>().Assign(spriteBall);
gameObjectBall.BehaviourController.AddBehaviour<Collider2DAABBBehaviour>().AABBLocal = new AABB(-Vector2.One * 512f * .5f, Vector2.One * 512f * .5f);
gameObjectBall = gameManager.InstantiateGameObject<GameObject>();
// gameObjectBall = gameManager.InstantiateGameObject<GameObject>();
// gameObjectBall.Name = "Ball";
// gameObjectBall.Transform.Position = Vector2.UnitY * 30f;
// gameObjectBall.Transform.Scale = new Vector2(1f / 51.2f, 1f / 51.2f);
@ -170,6 +170,7 @@ public class Game1 : Game
{
physicsTimer += 0.01f;
engine.Step(.01f);
Console.WriteLine($"{physicsTimer} -> {gameObjectBall.Transform.Position}");
}
}
if (Keyboard.GetState().IsKeyDown(Keys.M))
@ -179,6 +180,7 @@ public class Game1 : Game
{
physicsTimer -= 0.01f;
engine.Step(-.01f);
Console.WriteLine($"{physicsTimer} -> {gameObjectBall.Transform.Position}");
}
}
if (Keyboard.GetState().IsKeyDown(Keys.Space))