SilasCommit
This commit is contained in:
parent
ba49674c3b
commit
c9523578e4
3 changed files with 28 additions and 28 deletions
|
@ -12,20 +12,22 @@ namespace DangerousD.GameCore.GameObjects.Entities
|
||||||
{
|
{
|
||||||
public class SilasBall : LivingEntity
|
public class SilasBall : LivingEntity
|
||||||
{
|
{
|
||||||
public bool IsVisibility=true;
|
|
||||||
|
private Vector2 v;
|
||||||
public SilasBall(Vector2 position) : base(position)
|
public SilasBall(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
Height = 60;
|
Height = 24;
|
||||||
Width = 60;
|
Width = 24;
|
||||||
acceleration = Vector2.Zero;
|
acceleration = Vector2.Zero;
|
||||||
|
|
||||||
}
|
}
|
||||||
public SilasBall(Vector2 position, Vector2 velosity) : base(position)
|
public SilasBall(Vector2 position, Vector2 velosity) : base(position)
|
||||||
{
|
{
|
||||||
Height = 60;
|
Height = 24;
|
||||||
Width = 60;
|
Width = 24;
|
||||||
acceleration = Vector2.Zero;
|
acceleration = Vector2.Zero;
|
||||||
velocity = velosity;
|
velocity = velosity;
|
||||||
|
v = velosity;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,17 +35,17 @@ namespace DangerousD.GameCore.GameObjects.Entities
|
||||||
public override void Update(GameTime gameTime)
|
public override void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
base.Update(gameTime);
|
base.Update(gameTime);
|
||||||
if (AppManager.Instance.GameManager.physicsManager.CheckRectangle(Rectangle).Count>0)
|
if (AppManager.Instance.GameManager.physicsManager.CheckRectangle( new Rectangle(Rectangle.X-2,Rectangle.Y-2,Rectangle.Width+8,Rectangle.Height+8)).Count>0)
|
||||||
{
|
{
|
||||||
IsVisibility = false;
|
AppManager.Instance.GameManager.Remove(this);
|
||||||
}
|
}
|
||||||
|
velocity = v;
|
||||||
}
|
}
|
||||||
public override void Draw(SpriteBatch spriteBatch)
|
public override void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
if (IsVisibility)
|
|
||||||
{
|
base.Draw(spriteBatch);
|
||||||
base.Draw(spriteBatch);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,8 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||||
public SilasHands(Vector2 position) : base(position)
|
public SilasHands(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
name = "SilasHand";
|
name = "SilasHand";
|
||||||
Width = 48;
|
Width = 16;
|
||||||
Height = 48;
|
Height = 16;
|
||||||
monster_health = 2;
|
monster_health = 2;
|
||||||
monster_speed = 2;
|
monster_speed = 2;
|
||||||
acceleration = Vector2.Zero;
|
acceleration = Vector2.Zero;
|
||||||
|
|
|
@ -24,21 +24,17 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||||
public SilasMaster(Vector2 position) : base(position)
|
public SilasMaster(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
name = "SilasMaster";
|
name = "SilasMaster";
|
||||||
Width = 144;
|
Width = 48;
|
||||||
Height = 160;
|
Height = 53;
|
||||||
monster_health = 15;
|
monster_health = 15;
|
||||||
monster_speed = 4;
|
monster_speed = 2;
|
||||||
acceleration = Vector2.Zero;
|
acceleration = Vector2.Zero;
|
||||||
leftBorder = (int)position.X - 60;
|
leftBorder = (int)position.X - 60;
|
||||||
rightBorder = (int)position.X + 120;
|
rightBorder = (int)position.X + 120;
|
||||||
acceleration = Vector2.Zero;
|
acceleration = Vector2.Zero;
|
||||||
hands.Add(new SilasHands(new Vector2(Pos.X+60,Pos.Y+120)));
|
hands.Add(new SilasHands(new Vector2(Pos.X+0,Pos.Y+53)));
|
||||||
hands.Add(new SilasHands(new Vector2(Pos.X + 90, Pos.Y + 120)));
|
hands.Add(new SilasHands(new Vector2(Pos.X + 24, Pos.Y + 53)));
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
SilasBall silasball = new SilasBall(new Vector2(Pos.X + i * 40, Pos.Y + 120), new Vector2((i - 2) * 4, 6));
|
|
||||||
balls.Add(silasball);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
protected override GraphicsComponent GraphicsComponent { get; } = new GraphicsComponent(new List<string>() { "SilasMove", "SilasAttack" }, "SilasMove");
|
protected override GraphicsComponent GraphicsComponent { get; } = new GraphicsComponent(new List<string>() { "SilasMove", "SilasAttack" }, "SilasMove");
|
||||||
public override void Attack()
|
public override void Attack()
|
||||||
|
@ -64,13 +60,15 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||||
|
|
||||||
private void SpawnAttackBall()
|
private void SpawnAttackBall()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < balls.Count; i++)
|
balls.Clear();
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
balls[i].SetPosition(new Vector2(Pos.X + i * 40, Pos.Y + 120));
|
SilasBall silasball = new SilasBall(new Vector2(Pos.X + i * 12, Pos.Y + 53), new Vector2((i - 2) * 2, 2));
|
||||||
balls[i].IsVisibility=true;
|
|
||||||
|
balls.Add(silasball);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Attack(GameTime gameTime)
|
public void Attack(GameTime gameTime)
|
||||||
|
|
Loading…
Add table
Reference in a new issue