From 74d5833ac684b14ff39de57138747579a11f8e8e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Aug 2024 14:59:29 +0300 Subject: [PATCH 1/3] ent --- ZoFo/GameCore/GameObjects/Entity.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ZoFo/GameCore/GameObjects/Entity.cs b/ZoFo/GameCore/GameObjects/Entity.cs index 03124ac..db76947 100644 --- a/ZoFo/GameCore/GameObjects/Entity.cs +++ b/ZoFo/GameCore/GameObjects/Entity.cs @@ -1,8 +1,17 @@ using System; +using System.Numerics; namespace ZoFo; public class Entity { - + Vector2 position; + public Entity(Vector2 position) + { + this.position = position; + } + public virtual void SetPosition(Vector2 position) + { + Vector2 pos = position; + } } From 2ebbf450e740a2091a1f99d2f0cde52d342605bd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Aug 2024 17:04:15 +0300 Subject: [PATCH 2/3] LivingEntityRework --- ZoFo/GameCore/GameObjects/Entity.cs | 43 ++--------------------- ZoFo/GameCore/GameObjects/LivingEntity.cs | 23 ++++++++++++ 2 files changed, 26 insertions(+), 40 deletions(-) diff --git a/ZoFo/GameCore/GameObjects/Entity.cs b/ZoFo/GameCore/GameObjects/Entity.cs index 3f3c663..8653521 100644 --- a/ZoFo/GameCore/GameObjects/Entity.cs +++ b/ZoFo/GameCore/GameObjects/Entity.cs @@ -1,42 +1,5 @@ -using System; -using ZoFo.GameCore.GameObjects; -using Microsoft.Xna.Framework.Content; - -namespace ZoFo.GameCore.GameObjects; +namespace ZoFo.GameCore.GameObjects; public class Entity : GameObject -{ - public int Id{ get; set; } - //public CollisionComponent collisionComponents{ get; set; } - //public AnimationComponent animationComponent{ get; set; } +{ - // в апдейте может заявляет изменения позиции - public void UpdateLogic() - { -using System.Numerics; - - } - - - - // Методы для клиента - public void UpdateAnimation() - { - -public class Entity -{ - Vector2 position; - public Entity(Vector2 position) - { - this.position = position; - } - public virtual void SetPosition(Vector2 position) - { - Vector2 pos = position; - } -} - } - public void Draw(ContentManager manager) - { - - } -} +} \ No newline at end of file diff --git a/ZoFo/GameCore/GameObjects/LivingEntity.cs b/ZoFo/GameCore/GameObjects/LivingEntity.cs index 44270fa..663a411 100644 --- a/ZoFo/GameCore/GameObjects/LivingEntity.cs +++ b/ZoFo/GameCore/GameObjects/LivingEntity.cs @@ -3,5 +3,28 @@ namespace ZoFo.GameCore.GameObjects; public class LivingEntity : Entity { + public bool isOnGround = true; + public Vector2 velocity; + public Vector2 acceleration; + public Vector2 Acceleration { get; private set; } + public LivingEntity(Vector2 position) : base(position) + { + acceleration = new Vector2(0, 30); + } + public override void SetPosition(Vector2 position) + { + _pos = position; + } + public override void Update(GameTime gameTime) + { + base.Update(gameTime); + } + public virtual void StartCicycleAnimation(string animationName) + { + if (GraphicsComponent.GetCurrentAnimation != animationName) + { + GraphicsComponent.StartAnimation(animationName); + } + } } From f3c2220769f4d1a4bc47fae2271d30495f245a02 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Aug 2024 17:17:25 +0300 Subject: [PATCH 3/3] smallEdit --- ZoFo/GameCore/GameObjects/Entity.cs | 36 ++++++++++++++++++++--- ZoFo/GameCore/GameObjects/LivingEntity.cs | 32 +++++++------------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/ZoFo/GameCore/GameObjects/Entity.cs b/ZoFo/GameCore/GameObjects/Entity.cs index 8653521..d6809dd 100644 --- a/ZoFo/GameCore/GameObjects/Entity.cs +++ b/ZoFo/GameCore/GameObjects/Entity.cs @@ -1,5 +1,33 @@ -namespace ZoFo.GameCore.GameObjects; -public class Entity : GameObject -{ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; -} \ No newline at end of file +namespace ZoFo.GameCore.GameObjects +{ + public abstract class Entity : GameObject + { + public int Id { get; set; } + public void CollisionComponent() + { + + } + + public void AnimationComponent() + { + + } + + public void UpdateLogic() + { + + } + + } +} + +//вектор +//вилосити +//поситион +//текстура diff --git a/ZoFo/GameCore/GameObjects/LivingEntity.cs b/ZoFo/GameCore/GameObjects/LivingEntity.cs index 663a411..d8c8ed7 100644 --- a/ZoFo/GameCore/GameObjects/LivingEntity.cs +++ b/ZoFo/GameCore/GameObjects/LivingEntity.cs @@ -1,30 +1,20 @@ -using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; namespace ZoFo.GameCore.GameObjects; public class LivingEntity : Entity { - public bool isOnGround = true; public Vector2 velocity; - public Vector2 acceleration; - public Vector2 Acceleration { get; private set; } - public LivingEntity(Vector2 position) : base(position) + public Vector2 position; + + public void TextureLoad(SpriteBatch spriteBatch) { - acceleration = new Vector2(0, 30); - } - public override void SetPosition(Vector2 position) - { - _pos = position; } - public override void Update(GameTime gameTime) - { - base.Update(gameTime); - } - public virtual void StartCicycleAnimation(string animationName) - { - if (GraphicsComponent.GetCurrentAnimation != animationName) - { - GraphicsComponent.StartAnimation(animationName); - } - } + } + + + +