chore: Physics Test

This commit is contained in:
Syntriax 2024-01-25 22:04:04 +03:00
parent 80c0f4cdd6
commit e252d8fbb2
2 changed files with 4 additions and 2 deletions

2
Engine

@ -1 +1 @@
Subproject commit 9e1f38897fe9fbb229631dc5886bb0fe79e56427 Subproject commit 0ba8927858a4f43ce59ddd5917fb65d469786e5d

View File

@ -79,6 +79,8 @@ public class Game1 : Game
gameObjectCircle2.Name = "Circle2"; gameObjectCircle2.Name = "Circle2";
gameObjectCircle2.Transform.Position = new Vector2D(0f, 50f); gameObjectCircle2.Transform.Position = new Vector2D(0f, 50f);
gameObjectCircle2.Transform.Scale = new Vector2D(25f, 25f); gameObjectCircle2.Transform.Scale = new Vector2D(25f, 25f);
gameObjectCircle2.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
gameObjectCircle2.BehaviourController.AddBehaviour<MovementBoxBehaviour>(Keys.Up, Keys.Down, 268f, -268f, 400f);
gameObjectCircle2.BehaviourController.AddBehaviour<CircleBehaviour>(new Circle(Vector2D.Zero, 1f)); gameObjectCircle2.BehaviourController.AddBehaviour<CircleBehaviour>(new Circle(Vector2D.Zero, 1f));
engine.AddRigidBody(gameObjectCircle2.BehaviourController.AddBehaviour<RigidBody2D>()); engine.AddRigidBody(gameObjectCircle2.BehaviourController.AddBehaviour<RigidBody2D>());
@ -178,7 +180,7 @@ public class Game1 : Game
while (physicsTimer + 0.01f < gameTime.TotalGameTime.TotalMilliseconds * .001f)//seconds) while (physicsTimer + 0.01f < gameTime.TotalGameTime.TotalMilliseconds * .001f)//seconds)
{ {
Console.WriteLine($"Physics Timer: {physicsTimer}"); // Console.WriteLine($"Physics Timer: {physicsTimer}");
physicsTimer += 0.01f; physicsTimer += 0.01f;
engine.Step(.01f); engine.Step(.01f);
} }