SilosMasterVersion1
This commit is contained in:
parent
a2fc6a5db4
commit
e54900307d
6 changed files with 84 additions and 5 deletions
Binary file not shown.
Before Width: | Height: | Size: 24 KiB |
20
DangerousD/Content/animations/SilasAttack
Normal file
20
DangerousD/Content/animations/SilasAttack
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"id": "SilasAttack",
|
||||
"textureName": "MonstersAnimations",
|
||||
"startSpriteRectangle": {
|
||||
"X": 1,
|
||||
"Y": 618,
|
||||
"Width": 72,
|
||||
"Height": 80
|
||||
},
|
||||
"frameSecond": [
|
||||
{
|
||||
"Item1": 0,
|
||||
"Item2": 5
|
||||
}
|
||||
],
|
||||
"textureFrameInterval": 1,
|
||||
"framesCount": 2,
|
||||
"isCycle": true,
|
||||
"offset": "0, 0"
|
||||
}
|
|
@ -1 +1,20 @@
|
|||
{"id":"SilasMove","textureName":"animation1","startSpriteRectangle":{"X":1,"Y":618,"Width":72,"Height":80},"frameSecond":[{"Item1":0,"Item2":30}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
||||
{
|
||||
"id": "SilasMove",
|
||||
"textureName": "MonstersAnimations",
|
||||
"startSpriteRectangle": {
|
||||
"X": 1,
|
||||
"Y": 618,
|
||||
"Width": 72,
|
||||
"Height": 80
|
||||
},
|
||||
"frameSecond": [
|
||||
{
|
||||
"Item1": 0,
|
||||
"Item2": 60
|
||||
}
|
||||
],
|
||||
"textureFrameInterval": 1,
|
||||
"framesCount": 2,
|
||||
"isCycle": true,
|
||||
"offset": "0, 0"
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
}
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
base.Update(gameTime);
|
||||
if ((Pos.X + 20 <= AppManager.Instance.GameManager.GetPlayer1.Pos.X || Pos.X - 20 >= AppManager.Instance.GameManager.GetPlayer1.Pos.X)&&(Pos.Y + 20 <= AppManager.Instance.GameManager.GetPlayer1.Pos.Y || Pos.Y - 20 >= AppManager.Instance.GameManager.GetPlayer1.Pos.Y))
|
||||
{
|
||||
|
||||
|
|
|
@ -12,14 +12,31 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
{
|
||||
public class SilasMaster : CoreEnemy
|
||||
{
|
||||
private int attackTime = 60;
|
||||
private int moveTime = 360;
|
||||
private int currentTime = 0;
|
||||
public SilasMaster(Vector2 position) : base(position)
|
||||
{
|
||||
|
||||
name = "SilasMaster";
|
||||
Width = 144;
|
||||
Height = 160;
|
||||
monster_health = 15;
|
||||
monster_speed = 4;
|
||||
acceleration = Vector2.Zero;
|
||||
}
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new GraphicsComponent(new List<string>() { "SilasMove" }, "SilasMove");
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new GraphicsComponent(new List<string>() { "SilasMove", "SilasAttack" }, "SilasMove");
|
||||
public override void Attack()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (currentTime==0)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("SilasAttack");
|
||||
}
|
||||
else if (currentTime >= attackTime)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("SilasMove");
|
||||
currentTime = 0;
|
||||
}
|
||||
currentTime++;
|
||||
}
|
||||
|
||||
public override void Death()
|
||||
|
@ -29,7 +46,28 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
|
||||
public override void Move(GameTime gameTime)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (currentTime == 0)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("SilasMove");
|
||||
}
|
||||
else if (currentTime >= moveTime)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("SilasAttack");
|
||||
currentTime = 0;
|
||||
}
|
||||
currentTime++;
|
||||
}
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
base.Update(gameTime);
|
||||
if (GraphicsComponent.CurrentAnimation.Id=="SilasMove")
|
||||
{
|
||||
Move(gameTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Attack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace DangerousD.GameCore.Levels
|
|||
var Zombie = new Zombie(new Vector2(300, 64));
|
||||
var Frank = new Frank(new Vector2(100, 64));
|
||||
var SilasHand = new SilasHands(new Vector2(200,64));
|
||||
var SilasMaster = new SilasMaster(new Vector2(400, 64));
|
||||
new GrassBlock(new Vector2(0, 224));
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue