oops
This commit is contained in:
parent
22b02c4590
commit
6afcde1f98
1 changed files with 28 additions and 1 deletions
|
|
@ -13,8 +13,35 @@ public partial class RedirectEffect : Effect
|
|||
public override void Enter(Entity target)
|
||||
{
|
||||
if (target is RuntimeZombieData zombieData)
|
||||
{
|
||||
zombieData.AbleToEat = false;
|
||||
//Animation call
|
||||
int mult;
|
||||
if ((int)zombieData.GlobalPosition.Y / FieldParams.TileHeight <= 2)
|
||||
{
|
||||
mult = 1;
|
||||
}
|
||||
else if ((int)zombieData.GlobalPosition.Y / FieldParams.TileHeight >= 6)
|
||||
{
|
||||
mult = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (down)
|
||||
{
|
||||
mult = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mult = -1;
|
||||
}
|
||||
}
|
||||
zombieData.AbleToEat = false;
|
||||
var tween = zombieData.CreateTweenEffect(this);
|
||||
tween.TweenProperty(zombieData, "position:y", zombieData.GlobalPosition.Y + FieldParams.TileHeight * mult, Duration);
|
||||
tween.Parallel().TweenProperty(zombieData, "position:x", zombieData.GlobalPosition.X - FieldParams.TileHeight * tilesWalked, Duration);
|
||||
tween.TweenCallback(Callable.From(() => { zombieData.AbleToEat = true; }));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Exit(Entity target)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue