flameskull move add
This commit is contained in:
parent
9b2a57cd85
commit
1dfb23266b
2 changed files with 49 additions and 12 deletions
|
@ -13,14 +13,29 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||||
public class FlameSkull : CoreEnemy
|
public class FlameSkull : CoreEnemy
|
||||||
{
|
{
|
||||||
private bool isAttack;
|
private bool isAttack;
|
||||||
|
protected Vector2 startPosition;
|
||||||
|
protected Vector2[] positions = { new Vector2(-25, 242), new Vector2(-25, 332), new Vector2(582, 332), new Vector2(-25, 332),
|
||||||
|
new Vector2(-25, 444), new Vector2(581, 444), new Vector2(-25, 444), new Vector2(-25, 242), new Vector2(-25, 242),
|
||||||
|
new Vector2(-25, 242), new Vector2(-25, 149), new Vector2(-25, 149) };
|
||||||
|
protected int i;
|
||||||
|
|
||||||
public FlameSkull(Vector2 position) : base(position)
|
public FlameSkull(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
|
//581 149 stairs 4 [7]
|
||||||
|
//-25 149 verv 4 [6]
|
||||||
|
//-25 242 spawn 3 [5]
|
||||||
|
//-25 242 verv 3 [4]
|
||||||
|
//-25 332 verv 2 [3]
|
||||||
|
//582 332 stairs 2 [2]
|
||||||
|
//-25 444 verv 1 [1]
|
||||||
|
//581 444 stairs 1 [0]
|
||||||
|
i = 0;
|
||||||
Width = 62;
|
Width = 62;
|
||||||
Height = 40;
|
Height = 40;
|
||||||
monster_speed = 0.25f;
|
monster_speed = 1;
|
||||||
name = "Skull";
|
name = "Skull";
|
||||||
acceleration = Vector2.Zero;
|
acceleration = Vector2.Zero;
|
||||||
|
startPosition = new Vector2();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "FlameSkullMoveRight" , "FlameSkullMoveLeft"}, "FlameSkullMoveRight");
|
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "FlameSkullMoveRight" , "FlameSkullMoveLeft"}, "FlameSkullMoveRight");
|
||||||
|
@ -63,6 +78,38 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||||
}
|
}
|
||||||
velocity.X = -monster_speed;
|
velocity.X = -monster_speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i%2 == 0)
|
||||||
|
{
|
||||||
|
if (Pos.X > positions[i].X)
|
||||||
|
{
|
||||||
|
isGoRight = false;
|
||||||
|
}
|
||||||
|
else if (Pos.X < positions[i].X)
|
||||||
|
{
|
||||||
|
isGoRight = true;
|
||||||
|
}
|
||||||
|
else if (Pos.X == positions[i].X)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
velocity.X = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Pos.Y > positions[i].Y)
|
||||||
|
{
|
||||||
|
_pos.Y -= monster_speed;
|
||||||
|
}
|
||||||
|
else if (Pos.Y < positions[i].Y)
|
||||||
|
{
|
||||||
|
_pos.Y += monster_speed;
|
||||||
|
}
|
||||||
|
else if (Pos.Y == positions[i].Y)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Attack(GameTime gameTime)
|
public override void Attack(GameTime gameTime)
|
||||||
|
@ -72,10 +119,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||||
|
|
||||||
public override void Target()
|
public override void Target()
|
||||||
{
|
{
|
||||||
if (true)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,14 +200,7 @@ namespace DangerousD.GameCore
|
||||||
case GameState.Lobby:
|
case GameState.Lobby:
|
||||||
break;
|
break;
|
||||||
case GameState.Game:
|
case GameState.Game:
|
||||||
<<<<<<< HEAD
|
|
||||||
GameManager.mapManager.LoadLevel("map");
|
GameManager.mapManager.LoadLevel("map");
|
||||||
=======
|
|
||||||
|
|
||||||
GameManager.mapManager.LoadLevel("lvl");
|
|
||||||
|
|
||||||
|
|
||||||
>>>>>>> main
|
|
||||||
GameManager.FindBorders();
|
GameManager.FindBorders();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue