Example #1
0
 public override void Update()
 {
     if (FP.Distance(X, Y, World.Camera.X, World.Camera.Y) < 400)
     {
         cloak.Play("Reveal");
     }
 }
Example #2
0
        public override void Update()
        {
            base.Update();

            if (Target != null)
            {
                float x = Target.X, y = Target.Top - 40;
                MoveTowards(x, y, FP.Distance(X, Y, x, y) * 0.3f);
            }
        }
Example #3
0
        public void DoReceiveAttack(object[] args)
        {
            string userName = (string)args[0];

            if (userName == TwitchUserComEntityData.TwitchUserName)
            {
                return;
            }
            ComEntity attacker = (ComEntity)args[1];

            if (FP.Distance(X, Y, attacker.X, attacker.Y) < 60)
            {
                Interrupt();
                //hitVector

                var hitDistance = FP.Scale(TwitchUserComEntityData.Damage, DamageMin, DamageMax, HitDistanceMin, HitDistanceMax);
                TwitchUserComEntityData.Damage += DamageAmount;
                QueueCommand(new ComEntityMoveTo(this, (new Point(X, Y) + new Point(X - attacker.X, Y - attacker.Y).Normalized() * hitDistance), true, userName));
            }
        }
Example #4
0
 public override bool IsDone()
 {
     return(isKill || FP.Distance(comEntity.X, comEntity.Y, moveTo.X, moveTo.Y) < 1);
 }
Example #5
0
 public void MoveToward(float x1, float y1, float dx, float dy)
 {
     MoveToward(x1, y1, FP.Distance(X, Y, X + dx, Y + dy));
 }