From 9b346891f268ef9361452d99956d85bf18e91915 Mon Sep 17 00:00:00 2001 From: Timofey06 Date: Thu, 17 Aug 2023 17:28:29 +0300 Subject: [PATCH] physics fix pack 3 --- DangerousD/GameCore/GameObjects/GameObject.cs | 2 +- .../GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs | 2 +- DangerousD/GameCore/GameObjects/MapObjects/Platform.cs | 2 +- DangerousD/GameCore/GameObjects/MapObjects/StopTile.cs | 2 +- DangerousD/GameCore/Managers/PhysicsManager.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DangerousD/GameCore/GameObjects/GameObject.cs b/DangerousD/GameCore/GameObjects/GameObject.cs index 2553820..d276984 100644 --- a/DangerousD/GameCore/GameObjects/GameObject.cs +++ b/DangerousD/GameCore/GameObjects/GameObject.cs @@ -55,7 +55,7 @@ namespace DangerousD.GameCore { GraphicsComponent.DrawAnimation(Rectangle, spriteBatch); //debug - spriteBatch.Draw(debugTexture,new Rectangle(Rectangle.X-GraphicsComponent.CameraPosition.X,Rectangle.Y-GraphicsComponent.CameraPosition.Y,Rectangle.Width,Rectangle.Height), Color.White); + //wdaspriteBatch.Draw(debugTexture,new Rectangle(Rectangle.X-GraphicsComponent.CameraPosition.X,Rectangle.Y-GraphicsComponent.CameraPosition.Y,Rectangle.Width,Rectangle.Height), Color.White); } } diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs index 7302e72..b841dbd 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs @@ -23,7 +23,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters { Width = 24; Height = 40; - monster_speed = 3; + monster_speed = 1; name = "Zombie"; leftBorder = (int)position.X - 100; rightBorder = (int)position.X + 100; diff --git a/DangerousD/GameCore/GameObjects/MapObjects/Platform.cs b/DangerousD/GameCore/GameObjects/MapObjects/Platform.cs index fc14c79..f69d7c9 100644 --- a/DangerousD/GameCore/GameObjects/MapObjects/Platform.cs +++ b/DangerousD/GameCore/GameObjects/MapObjects/Platform.cs @@ -14,7 +14,7 @@ public class Platform : MapObject { base.Draw(spriteBatch); //debug - spriteBatch.Draw(debugTexture, new Rectangle(Rectangle.X - GraphicsComponent.CameraPosition.X, Rectangle.Y - GraphicsComponent.CameraPosition.Y, Rectangle.Width, Rectangle.Height), Color.White); + //spriteBatch.Draw(debugTexture, new Rectangle(Rectangle.X - GraphicsComponent.CameraPosition.X, Rectangle.Y - GraphicsComponent.CameraPosition.Y, Rectangle.Width, Rectangle.Height), Color.Blue); } diff --git a/DangerousD/GameCore/GameObjects/MapObjects/StopTile.cs b/DangerousD/GameCore/GameObjects/MapObjects/StopTile.cs index ab4f6d4..b4fb7a5 100644 --- a/DangerousD/GameCore/GameObjects/MapObjects/StopTile.cs +++ b/DangerousD/GameCore/GameObjects/MapObjects/StopTile.cs @@ -14,7 +14,7 @@ public class StopTile : MapObject { base.Draw(spriteBatch); //debug - spriteBatch.Draw(debugTexture, new Rectangle(Rectangle.X - GraphicsComponent.CameraPosition.X, Rectangle.Y - GraphicsComponent.CameraPosition.Y, Rectangle.Width, Rectangle.Height), Color.White); + // spriteBatch.Draw(debugTexture, new Rectangle(Rectangle.X - GraphicsComponent.CameraPosition.X, Rectangle.Y - GraphicsComponent.CameraPosition.Y, Rectangle.Width, Rectangle.Height), Color.White); } } \ No newline at end of file diff --git a/DangerousD/GameCore/Managers/PhysicsManager.cs b/DangerousD/GameCore/Managers/PhysicsManager.cs index c89d9c1..e16309f 100644 --- a/DangerousD/GameCore/Managers/PhysicsManager.cs +++ b/DangerousD/GameCore/Managers/PhysicsManager.cs @@ -48,7 +48,7 @@ namespace DangerousD.GameCore.Managers oldRect.Offset((int)currentEntity.velocity.X, 0); for (int j = 0; j < mapObjects.Count; j++) { - if (Math.Abs(mapObjects[i].Pos.X - currentEntity.Pos.X) < currentEntity.velocity.X * 2 && Math.Abs(mapObjects[i].Pos.Y - currentEntity.Pos.Y) < 50) + if (Math.Abs(mapObjects[i].Pos.X - currentEntity.Pos.X) < 550 && Math.Abs(mapObjects[i].Pos.Y - currentEntity.Pos.Y) < 550) { if (oldRect.Intersects(mapObjects[j].Rectangle)) {