This commit is contained in:
Rendo 2025-07-13 03:59:09 +05:00
commit 2156c6a166
16 changed files with 490 additions and 5 deletions

View file

@ -5,6 +5,7 @@ namespace Newlon.Systems.Effects;
public partial class GarlicEffect : Effect
{
[Export] private float tilesWalked = 0.2f;
RandomNumberGenerator RandomNumberGenerator;
public override void Enter(Node target)
@ -43,9 +44,10 @@ public partial class GarlicEffect : Effect
mult = -1;
}
}
zombieData.AbleToEat = false;
var tween = zombieData.CreateTween();
tween.TweenProperty(zombieData,"position:y",zombieData.GlobalPosition.Y + Utility.TileHeight * mult, 1.0);
tween.Parallel().TweenProperty(zombieData, "position:x", zombieData.GlobalPosition.X - Utility.TileWidth / 10.0, 1.0);
tween.TweenProperty(zombieData,"position:y",zombieData.GlobalPosition.Y + Utility.TileHeight * mult, Duration);
tween.Parallel().TweenProperty(zombieData, "position:x", zombieData.GlobalPosition.X - Utility.TileHeight * tilesWalked, Duration);
tween.TweenCallback(Callable.From(() => {zombieData.AbleToEat = true;}));
}
}