From 5f36ee7b79deba5dfb0653759a9a43cf391710e7 Mon Sep 17 00:00:00 2001 From: bmvolf Date: Fri, 18 Aug 2023 02:19:11 +0300 Subject: [PATCH 1/3] edited player --- DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs index 066b1d4..eef557f 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs @@ -9,6 +9,7 @@ using DangerousD.GameCore.GameObjects.PlayerDeath; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Graphics; using DangerousD.GameCore.GameObjects.LivingEntities.Monsters; +using DangerousD.GameCore.Network; namespace DangerousD.GameCore.GameObjects.LivingEntities { From f26c88ffdcbe56f6b27a22afea47d992a1d714cd Mon Sep 17 00:00:00 2001 From: bmvolf Date: Fri, 18 Aug 2023 03:16:42 +0300 Subject: [PATCH 2/3] nightCommit --- DangerousD/GameCore/GUI/HUD.cs | 4 +--- .../GameCore/GameObjects/LivingEntities/Player/Player.cs | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DangerousD/GameCore/GUI/HUD.cs b/DangerousD/GameCore/GUI/HUD.cs index 07e446a..ee17186 100644 --- a/DangerousD/GameCore/GUI/HUD.cs +++ b/DangerousD/GameCore/GUI/HUD.cs @@ -11,7 +11,6 @@ namespace DangerousD.GameCore.GUI { public class HUD : AbstractGui { - int ammout = 0; List rects = new List { }; int wigth = AppManager.Instance.inGameResolution.X; int height = AppManager.Instance.inGameResolution.Y; @@ -27,9 +26,8 @@ namespace DangerousD.GameCore.GUI } public override void Update(GameTime gameTime) { - rects.Clear(); - for (int i = 0; i < ammout; i++) + for (int i = 0; i < AppManager.Instance.GameManager.GetPlayer1.Bullets; i++) { rects.Add(new Rect(Manager) { rectangle = new Rectangle(wigth / 29 + i * 13, height / 17, 5, 20), mainColor = Color.Yellow }); rects[i].LoadTexture(AppManager.Instance.Content); diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs index eef557f..2a2a7ca 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs @@ -30,6 +30,8 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities public GameObject objectAttack; private int bullets; + public int Bullets { get { return bullets; } } + public Player(Vector2 position) : base(position) { Width = 16; From 7b45a41dc1e1f376cc8c5b7a2c2214f5858cae26 Mon Sep 17 00:00:00 2001 From: Kaktus200020 Date: Fri, 18 Aug 2023 04:22:29 +0300 Subject: [PATCH 3/3] ParticlesReady --- .../Content/animations/GibsMoveLeftBottom | 1 + DangerousD/Content/animations/GibsMoveLeftTop | 1 + .../Content/animations/GibsMoveRightBottom | 1 + .../Content/animations/GibsMoveRightTop | 1 + DangerousD/Content/animations/GibsNotMove | 1 + DangerousD/Content/map.tmx | 75 +++++++++++++++++++ .../LivingEntities/Monsters/Zombie.cs | 7 ++ .../GameObjects/LivingEntities/Particle.cs | 46 ++++++++++++ 8 files changed, 133 insertions(+) create mode 100644 DangerousD/Content/animations/GibsMoveLeftBottom create mode 100644 DangerousD/Content/animations/GibsMoveLeftTop create mode 100644 DangerousD/Content/animations/GibsMoveRightBottom create mode 100644 DangerousD/Content/animations/GibsMoveRightTop create mode 100644 DangerousD/Content/animations/GibsNotMove create mode 100644 DangerousD/Content/map.tmx create mode 100644 DangerousD/GameCore/GameObjects/LivingEntities/Particle.cs diff --git a/DangerousD/Content/animations/GibsMoveLeftBottom b/DangerousD/Content/animations/GibsMoveLeftBottom new file mode 100644 index 0000000..b0f96f0 --- /dev/null +++ b/DangerousD/Content/animations/GibsMoveLeftBottom @@ -0,0 +1 @@ +{"id":"GibsMoveLeftBottom","textureName":"MonstersAnimations","startSpriteRectangle":{"X":70,"Y":724,"Width":14,"Height":11},"frameSecond":[{"Item1":0,"Item2":6}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"} diff --git a/DangerousD/Content/animations/GibsMoveLeftTop b/DangerousD/Content/animations/GibsMoveLeftTop new file mode 100644 index 0000000..e80c714 --- /dev/null +++ b/DangerousD/Content/animations/GibsMoveLeftTop @@ -0,0 +1 @@ +{"id":"GibsMoveLeftTop","textureName":"MonstersAnimations","startSpriteRectangle":{"X":2,"Y":721,"Width":14,"Height":12},"frameSecond":[{"Item1":0,"Item2":8}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"} diff --git a/DangerousD/Content/animations/GibsMoveRightBottom b/DangerousD/Content/animations/GibsMoveRightBottom new file mode 100644 index 0000000..246ab34 --- /dev/null +++ b/DangerousD/Content/animations/GibsMoveRightBottom @@ -0,0 +1 @@ +{"id":"GibsMoveRightBottom","textureName":"MonstersAnimations","startSpriteRectangle":{"X":106,"Y":722,"Width":13,"Height":12},"frameSecond":[{"Item1":0,"Item2":6}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"} diff --git a/DangerousD/Content/animations/GibsMoveRightTop b/DangerousD/Content/animations/GibsMoveRightTop new file mode 100644 index 0000000..4b193fd --- /dev/null +++ b/DangerousD/Content/animations/GibsMoveRightTop @@ -0,0 +1 @@ +{"id":"GibsMoveRightTop","textureName":"MonstersAnimations","startSpriteRectangle":{"X":37,"Y":721,"Width":14,"Height":13},"frameSecond":[{"Item1":0,"Item2":6}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"} diff --git a/DangerousD/Content/animations/GibsNotMove b/DangerousD/Content/animations/GibsNotMove new file mode 100644 index 0000000..e5333b8 --- /dev/null +++ b/DangerousD/Content/animations/GibsNotMove @@ -0,0 +1 @@ +{"id":"GibsNotMove","textureName":"MonstersAnimations","startSpriteRectangle":{"X":137,"Y":731,"Width":16,"Height":5},"frameSecond":[{"Item1":0,"Item2":10}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"} diff --git a/DangerousD/Content/map.tmx b/DangerousD/Content/map.tmx new file mode 100644 index 0000000..813425e --- /dev/null +++ b/DangerousD/Content/map.tmx @@ -0,0 +1,75 @@ + + + + + + +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294 + + +294,294,294,294,294,321,321,321,321,321,321,321,321,321,321,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,321,321,321,321,321,321,321,321,321,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321, +294,294,294,294,321,321,321,321,321,321,321,321,321,321,321,321 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs index 188dfb9..82dcc2a 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs @@ -78,7 +78,13 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters public override void Death() { + for (int i = 0; i < 3; i++) + { + Particle particle = new Particle(Pos); + } + AppManager.Instance.GameManager.Remove(this); + } public override void Move(GameTime gameTime) @@ -160,6 +166,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters { monster_health--; GraphicsComponent.StartAnimation("ZombieRightAttack"); + Particle particle = new Particle(Pos); if (monster_health <= 0) { Death(); diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Particle.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Particle.cs new file mode 100644 index 0000000..cf08319 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Particle.cs @@ -0,0 +1,46 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities +{ + public class Particle : LivingEntity + { + int delay; + public Particle(Vector2 position) : base(position) + { + Width = 14; + Height = 14; + Random random = new Random(); + velocity = new Vector2(random.Next(3, 15), random.Next(3,30)); + acceleration.Y = 10; + delay = 100; + + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "GibsMoveLeftBottom", "GibsMoveLeftTop", "GibsMoveRightBottom", "GibsMoveRightTop" }, "GibsMoveRightTop"); + public override void Update(GameTime gameTime) + { + delay--; + if (velocity.X > 0) + { + velocity.X--; + } + if(velocity.Y<=0) + { + GraphicsComponent.StartAnimation("GipsNoMove"); +; } + if(delay<=0) + { + AppManager.Instance.GameManager.Remove(this); + } + base.Update(gameTime); + } + + } +}