Merge branch 'particlesBranch'
This commit is contained in:
commit
4a24a75399
4 changed files with 47 additions and 10 deletions
1
DangerousD/Content/animations/playerShootUpLeft
Normal file
1
DangerousD/Content/animations/playerShootUpLeft
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"playerShootUpLeft","textureName":"playerAnimation","startSpriteRectangle":{"X":267,"Y":34,"Width":24,"Height":32},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"}
|
1
DangerousD/Content/animations/playerShootUpRight
Normal file
1
DangerousD/Content/animations/playerShootUpRight
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"playerShootUpRight","textureName":"playerAnimation","startSpriteRectangle":{"X":267,"Y":1,"Width":24,"Height":32},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"}
|
|
@ -8,6 +8,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DangerousD.GameCore.Managers;
|
||||
using DangerousD.GameCore.GameObjects;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||
{
|
||||
|
@ -24,7 +25,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
{
|
||||
Width = 24;
|
||||
Height = 40;
|
||||
monster_speed = 3;
|
||||
monster_speed = 2;
|
||||
name = "Zombie";
|
||||
monster_health = 2;
|
||||
leftBorder = (int)position.X - 100;
|
||||
|
@ -133,7 +134,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
|
||||
public void Target()
|
||||
{
|
||||
if (AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X - 50, (int)Pos.Y, Width + 100, Height), typeof(Player)).Count > 0)
|
||||
if (AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X - 50, (int)Pos.Y, Width + 200, Height), typeof(Player)).Count > 0)
|
||||
{
|
||||
if(isGoRight && this._pos.X <= AppManager.Instance.GameManager.players[0].Pos.X)
|
||||
{
|
||||
|
@ -183,5 +184,5 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
Death();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
public bool IsAlive { get { return isAlive; } }
|
||||
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "playerMoveLeft", "playerMoveRight", "DeathFromZombie", "playerRightStay", "playerStayLeft",
|
||||
"playerJumpRight" , "playerJumpLeft", "playerShootLeft", "playerShootRight", "playerReload", "smokeAfterShoot"}, "playerReload");
|
||||
"playerJumpRight" , "playerJumpLeft", "playerShootLeft", "playerShootRight", "playerReload", "smokeAfterShoot", "playerShootUpRight", "playerShootUpLeft"}, "playerReload");
|
||||
|
||||
public void Attack()
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
return;
|
||||
}
|
||||
isAttacked = true;
|
||||
if(monsterName == "Zombie")
|
||||
if (monsterName == "Zombie")
|
||||
{
|
||||
AnimationRectangle deathRectangle = new AnimationRectangle(Pos, "DeathFrom" + monsterName);
|
||||
deathRectangle.Gr.actionOfAnimationEnd += (a) =>
|
||||
|
@ -112,7 +112,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
}
|
||||
};
|
||||
}
|
||||
else if(monsterName == "Spider")
|
||||
else if (monsterName == "Spider")
|
||||
{
|
||||
AnimationRectangle deathRectangle = new AnimationRectangle(Pos, "DeathFrom" + monsterName);
|
||||
deathRectangle.Gr.actionOfAnimationEnd += (a) =>
|
||||
|
@ -187,7 +187,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
FallingThroughPlatform = false;
|
||||
}
|
||||
GraphicsComponent.SetCameraPosition(Pos);
|
||||
if (!isAttacked || AppManager.Instance.InputManager.InvincibilityCheat)
|
||||
if (!isAttacked || AppManager.Instance.InputManager.InvincibilityCheat)
|
||||
{
|
||||
if (!isShooting)
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
}
|
||||
else if (AppManager.Instance.InputManager.VectorMovementDirection.X == 0)//стоит
|
||||
{
|
||||
if(bullets < 5)
|
||||
if (bullets < 5)
|
||||
{
|
||||
if (GraphicsComponent.GetCurrentAnimation != "playerReload")
|
||||
{
|
||||
|
@ -239,19 +239,53 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
}
|
||||
else if (isRight)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("playerRightStay");
|
||||
if (isUping)
|
||||
{
|
||||
if (GraphicsComponent.GetCurrentAnimation != "playerShootUpRight")
|
||||
{
|
||||
GraphicsComponent.StartAnimation("playerShootUpRight");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GraphicsComponent.StartAnimation("playerRightStay");
|
||||
}
|
||||
}
|
||||
else if (!isRight)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("playerStayLeft");
|
||||
if (isUping)
|
||||
{
|
||||
if (GraphicsComponent.GetCurrentAnimation != "playerShootUpLeft")
|
||||
{
|
||||
GraphicsComponent.StartAnimation("playerShootUpLeft");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GraphicsComponent.StartAnimation("playerStayLeft");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (AppManager.Instance.multiPlayerStatus != MultiPlayerStatus.SinglePlayer)
|
||||
{
|
||||
NetworkTask task = new NetworkTask(id, Pos);
|
||||
AppManager.Instance.NetworkTasks.Add(task);
|
||||
}
|
||||
}
|
||||
public void MoveDown()
|
||||
{
|
||||
FallingThroughPlatform = true;
|
||||
isOnGround = false;
|
||||
}
|
||||
|
||||
public class Bullet : GameObjects.LivingEntity
|
||||
{
|
||||
public Bullet(Vector2 position) : base(position)
|
||||
{
|
||||
}
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new("ZombieMoveLeft");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue