Fix inheritance

This commit is contained in:
Mootfrost777 2024-08-18 10:53:42 +03:00
parent 5a7fc98597
commit be0d38bb95
5 changed files with 7 additions and 6 deletions

View file

@ -12,7 +12,7 @@ namespace ZoFo.GameCore.GameObjects.Entities
{
//public override GraphicsComponent graphicsComponent { get; } = new GraphicsComponent(new List<string> { "тут пишите название анимации" }, "сдублируйте " +
public override AnimatedGraphicsComponent graphicsComponent { get; } = new(new List<string> { "player_running_top_rotate" }, "player_running_top_rotate");
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "player_running_top_rotate" }, "player_running_top_rotate");
public EntittyForAnimationTests(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0,16*12, 16 * 16);

View file

@ -21,7 +21,7 @@ public class LivingEntity : Entity
inputManager = new InputManager();
}
public override AnimatedGraphicsComponent graphicsComponent { get; } = null;
public override GraphicsComponent graphicsComponent { get; } = null;
#region Server side
/*public override void Update()

View file

@ -20,12 +20,12 @@ public class Player : LivingEntity
public bool IsTryingToShoot { get; set; }
private float speed;
private int health;
public override AnimatedGraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "player_running_top_rotate" }, "player_running_top_rotate", new Rectangle(0,0,100,100));
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "player_running_top_rotate" }, "player_running_top_rotate");
public Player(Vector2 position) : base(position)
{
//InputWeaponRotation = new Vector2(0, 0);
//InputPlayerRotation = new Vector2(0, 0);
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 100, 100);
collisionComponent.stopRectangle = new Rectangle(0, 0, 100, 100);
}

View file

@ -202,7 +202,6 @@ namespace ZoFo.GameCore.Graphics
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch)
{
DebugHUD.Instance.Log($"{destinationRectangle.Width} : {destinationRectangle.Height}");
Texture2D texture = textures[texturesNames.FindIndex(x => x == currentAnimation.TextureName)];
float scale;
@ -226,7 +225,6 @@ namespace ZoFo.GameCore.Graphics
destinationRectangle = Scaling(destinationRectangle);
_spriteBatch.Draw(texture,
destinationRectangle, sourceRectangle, Color.White);
DebugHUD.Instance.Log(texture.Name);
}
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch, Rectangle sourceRectangle)

View file

@ -99,6 +99,9 @@ namespace ZoFo.GameCore
AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(40, 40)));
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(140, 140)));
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(300, 140)));
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(450, 140)));
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(140, 140)));
}
/// <summary>