Merge branch 'livingEntitiesVlad' into livingEntities

This commit is contained in:
bmvolf 2023-08-16 13:24:33 +03:00
commit 8815d65e85
21 changed files with 337 additions and 18 deletions

View file

@ -13,18 +13,6 @@
#---------------------------------- Content ---------------------------------# #---------------------------------- Content ---------------------------------#
#begin ../../../animation1.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:../../../animation1.png;animation1.png
#begin File.spritefont #begin File.spritefont
/importer:FontDescriptionImporter /importer:FontDescriptionImporter
/processor:FontDescriptionProcessor /processor:FontDescriptionProcessor
@ -46,6 +34,18 @@
/processorParam:TextureFormat=Compressed /processorParam:TextureFormat=Compressed
/build:Font2.spritefont /build:Font2.spritefont
#begin MonstersAnimations.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:MonstersAnimations.png
#begin PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png #begin PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

View file

@ -0,0 +1 @@
{"id":"FrankMoveLeft","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":413,"Width":56,"Height":80},"frameSecond":[{"Item1":0,"Item2":18}],"textureFrameInterval":1,"framesCount":4,"isCycle":true}

View file

@ -0,0 +1 @@
{"id":"FrankMoveRight","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":332,"Width":56,"Height":80},"frameSecond":[{"Item1":0,"Item2":18}],"textureFrameInterval":1,"framesCount":4,"isCycle":true}

View file

@ -1 +1 @@
{"id":"ZombieLeftAttack","textureName":"animation1","startSpriteRectangle":{"X":126,"Y":50,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"} {"id":"ZombieLeftAttack","textureName":"MonstersAnimations","startSpriteRectangle":{"X":126,"Y":50,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"}

View file

@ -1 +1 @@
{"id":"ZombieMoveLeft","textureName":"animation1","startSpriteRectangle":{"X":1,"Y":50,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} {"id":"ZombieMoveLeft","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":50,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true}

View file

@ -1 +1 @@
{"id":"ZombieMoveRight","textureName":"animation1","startSpriteRectangle":{"X":1,"Y":9,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} {"id":"ZombieMoveRight","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":9,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true}

View file

@ -1 +1 @@
{"id":"ZombieRightAttack","textureName":"animation1","startSpriteRectangle":{"X":126,"Y":9,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"} {"id":"ZombieRightAttack","textureName":"MonstersAnimations","startSpriteRectangle":{"X":126,"Y":9,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"}

View file

@ -29,12 +29,15 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
Death(); Death();
isAlive = false; isAlive = false;
} }
Move(gameTime, AppManager.Instance.GameManager.Player);
base.Update(gameTime); base.Update(gameTime);
} }
public abstract void Death(); public abstract void Death();
public abstract void Attack(); public abstract void Attack();
public abstract void Move(GameTime gameTime); public abstract void Move(GameTime gameTime, Player player);
} }
} }

View file

@ -0,0 +1,37 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
public class FlameSkull : CoreEnemy
{
public FlameSkull(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "FlameSkullMoveLeft", "FlameSkullMoveRight" }, "FlameSkullMoveRight");
public override void Attack(Player player)
{
}
public override void Death()
{
}
public override void Move(GameTime gameTime, Player player)
{
}
}
}

View file

@ -0,0 +1,70 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
internal class Frank : CoreEnemy
{
private bool isGoRight = false;
public Frank(Vector2 position) : base(position)
{
Width = 112;
Height = 160;
GraphicsComponent.StartAnimation("FrankMoveLeft");
monster_speed = 1;
name = "Фрэнк";
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "FrankMoveRight", "FrankMoveLeft" }, "FrankMoveRight");
public override void Attack(Player player)
{
}
public override void Death()
{
}
public override void Move(GameTime gameTime, Player player)
{
/* if (player.Pos.X - _pos.X <= 20 || player.Pos.X - _pos.X <= -20)
{
player.Death(name);
} */
if (isGoRight)
{
if (GraphicsComponent.GetCurrentAnimation != "FrankMoveRight")
{
GraphicsComponent.StartAnimation("FrankMoveRight");
velocity = new Vector2(monster_speed, 0);
}
}
else if (!isGoRight)
{
if (GraphicsComponent.GetCurrentAnimation != "FrankMoveLeft")
{
GraphicsComponent.StartAnimation("FrankMoveLeft");
velocity = new Vector2(-monster_speed, 0);
}
}
if (_pos.X <= 1)
{
isGoRight = true;
}
else if (_pos.X >= 500)
{
isGoRight = false;
}
}
}
}

View file

@ -0,0 +1,36 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
public class Ghost : CoreEnemy
{
public Ghost(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "GhostMoveRight", "GhostMoveLeft", "GhostSpawn", "GhostAttack" }, "");
public override void Attack(Player player)
{
}
public override void Death()
{
}
public override void Move(GameTime gameTime, Player player)
{
}
}
}

View file

@ -0,0 +1,36 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
public class Hunchman : CoreEnemy
{
public Hunchman(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "HunchmanMoveLeft", "HunchmanMoveRight", "HunchmanAttackLeft", "HunchmanAttackRight" }, "HunchmanMoveRight");
public override void Attack(Player player)
{
}
public override void Death()
{
}
public override void Move(GameTime gameTime, Player player)
{
}
}
}

View file

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
internal class SilasHands
{
}
}

View file

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
public class SilasMaster
{
}
}

View file

@ -0,0 +1,38 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
public class Slime : CoreEnemy
{
public Slime(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "SlimeMoveLeftTop", "SlimeMoveLeftBottom", "SlimeMoveRightTop",
"SlimeMoveRightBottom", "SlimeReadyJumpRightBottom", "SlimeReadyJumpRightTop", "SlimeReadyJumpLeftBottom", "SlimeReadyJumpLeftTop", "SlimeJumpRightBottom",
"SlimeJumpRightTop", "SlimeJumpLeftBottom", "SlimeJumpLeftTop" }, "");
public override void Attack(Player player)
{
}
public override void Death()
{
}
public override void Move(GameTime gameTime, Player player)
{
}
}
}

View file

@ -0,0 +1,36 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
public class Spider : CoreEnemy
{
public Spider(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "SpiderMoveRight", "SpiderMoveLeft", "SpiderDown", "SpiderUp" }, "");
public override void Attack(Player player)
{
}
public override void Death()
{
}
public override void Move(GameTime gameTime, Player player)
{
}
}
}

View file

@ -0,0 +1,36 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{
public class Werewolf : CoreEnemy
{
public Werewolf(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "WolfMoveRight", "WolfMoveLeft", "WolfJumpRight", "WolfJumpLeft" }, "");
public override void Attack(Player player)
{
}
public override void Death()
{
}
public override void Move(GameTime gameTime, Player player)
{
}
}
}

View file

@ -61,7 +61,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
} }
public override void Move(GameTime gameTime) public override void Move(GameTime gameTime, Player player)
{ {
double delta = gameTime.ElapsedGameTime.TotalSeconds; double delta = gameTime.ElapsedGameTime.TotalSeconds;
if (isGoRight) if (isGoRight)

View file

@ -13,6 +13,7 @@ namespace DangerousD.GameCore.Levels
var Трава = new GrassBlock(new Vector2(0, 128)); var Трава = new GrassBlock(new Vector2(0, 128));
var Death = new TestAnimationDeath(new Vector2(128, 128)); var Death = new TestAnimationDeath(new Vector2(128, 128));
var Zombie = new Zombie(new Vector2(256, 128)); var Zombie = new Zombie(new Vector2(256, 128));
var Frank = new Frank(new Vector2(384, 128));
} }
} }
} }