Exemple #1
0
        public void Update(Sandwich sandwich)
        {
            if (isFalling)
            {
                if (this is Spider)
                {
                    RealPos.Y += GRAVITY;
                }
                RealPos.Y += GRAVITY;
            }

            Position.Y = (int)RealPos.Y;
            Position.X = (int)RealPos.X;
            foreach (LunchItem item in sandwich.current)
            {
                if (item.Position.Intersects(Position))
                {
                    HitSammich(sandwich, item);
                    return;
                }
            }
        }
Exemple #2
0
 public override void HitSammich(Sandwich target, LunchItem item)
 {
     mainRunner.SpiderLanded(this);
     base.HitSammich(target, item);
 }
Exemple #3
0
 public virtual void HitSammich(Sandwich target, LunchItem item)
 {
     RealPosition = new Vector2(RealPosition.X, item.RealPosition.Y - Height);
     target.current.Add(this);
     isFalling = false;
 }