SilasHand
This commit is contained in:
parent
9f8e7bcbd4
commit
99fe39c2c5
6 changed files with 103 additions and 7 deletions
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
|
||||
namespace AnimationsFileCreator
|
||||
{
|
||||
|
@ -62,7 +63,7 @@ namespace AnimationsFileCreator
|
|||
container.TextureFrameInterval = 1;
|
||||
container.Id = id;
|
||||
string json = JsonConvert.SerializeObject(container);
|
||||
StreamWriter writer = new StreamWriter(id);
|
||||
StreamWriter writer = new StreamWriter("../../../../DangerousD/Content/animations/"+id);
|
||||
writer.WriteLine(json);
|
||||
writer.Close();
|
||||
}
|
||||
|
|
1
DangerousD/Content/animations/SilasHandMove
Normal file
1
DangerousD/Content/animations/SilasHandMove
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"SilasHandMove","textureName":"MonstersAnimations","startSpriteRectangle":{"X":197,"Y":618,"Width":24,"Height":24},"frameSecond":[{"Item1":0,"Item2":8}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
|
@ -1,4 +1,8 @@
|
|||
using System;
|
||||
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;
|
||||
|
@ -6,7 +10,59 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||
{
|
||||
internal class SilasHands
|
||||
public class SilasHands : CoreEnemy
|
||||
{
|
||||
public SilasHands(Vector2 position) : base(position)
|
||||
{
|
||||
name = "SilasHand";
|
||||
Width = 48;
|
||||
Height = 48;
|
||||
monster_health = 2;
|
||||
monster_speed = 2;
|
||||
acceleration = Vector2.Zero;
|
||||
|
||||
}
|
||||
|
||||
protected override GraphicsComponent GraphicsComponent { get; }=new GraphicsComponent(new List<string>() { "SilasHandMove" }, "SilasHandMove");
|
||||
|
||||
public override void Attack()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Death()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Move(GameTime gameTime)
|
||||
{
|
||||
if (Pos.Y> AppManager.Instance.GameManager.GetPlayer1.Pos.Y)
|
||||
{
|
||||
velocity.Y = monster_speed;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.Y = 0;
|
||||
}
|
||||
if (Pos.X> AppManager.Instance.GameManager.GetPlayer1.Pos.X)
|
||||
{
|
||||
velocity.X = -monster_speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = monster_speed;
|
||||
}
|
||||
}
|
||||
public override void Update(GameTime 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))
|
||||
{
|
||||
|
||||
AppManager.Instance.GameManager.GetPlayer1.Death(name);
|
||||
}
|
||||
GraphicsComponent.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
using System;
|
||||
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;
|
||||
|
@ -6,7 +10,27 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||
{
|
||||
public class SilasMaster
|
||||
public class SilasMaster : CoreEnemy
|
||||
{
|
||||
public SilasMaster(Vector2 position) : base(position)
|
||||
{
|
||||
|
||||
}
|
||||
protected override GraphicsComponent GraphicsComponent => throw new NotImplementedException();
|
||||
|
||||
public override void Attack()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Death()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Move(GameTime gameTime)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,14 @@ namespace DangerousD.GameCore.Graphics
|
|||
private List<Texture2D> textures;
|
||||
private List<string> texturesNames;
|
||||
private AnimationContainer currentAnimation;
|
||||
|
||||
public AnimationContainer CurrentAnimation
|
||||
{
|
||||
get
|
||||
{
|
||||
return currentAnimation;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetCurrentAnimation
|
||||
{
|
||||
get { return currentAnimation.Id; }
|
||||
|
@ -24,6 +31,13 @@ namespace DangerousD.GameCore.Graphics
|
|||
//private SpriteBatch _spriteBatch;
|
||||
|
||||
private int currentFrame;
|
||||
public int CurrentFrame
|
||||
{
|
||||
get
|
||||
{
|
||||
return currentFrame;
|
||||
}
|
||||
}
|
||||
private int interval;
|
||||
private int lastInterval;
|
||||
private Rectangle sourceRectangle;
|
||||
|
|
|
@ -14,7 +14,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));
|
||||
new GrassBlock(new Vector2(0, 224));
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue