Example #1
0
 public void RegisterLimb(LimbPickup limb)
 {
     if (blobIDs.Add(limb.blob.ID))
     {
         allLimbs.Add(limb);
     }
 }
Example #2
0
        void Update_Flying()
        {
            velocity.Z += gravity * Time.deltaTime;
            position   += velocity * Time.deltaTime;
            this.blob.transform.Position = new Vector2(position.X, position.Y);
            this.scale = MathHelper.Lerp(1, 3, position.Z / -100);
            GameManager.Instance.secondLabel.GetComponent <Label>().text = position.Z.ToString();
            //this.rotation += rotateSpeed * Time.deltaTime;

            //bounced
            if (position.Z >= 0)
            {
                velocity   *= friction;
                velocity.Z *= -1;

                if (!GameManager.Instance.InVisualBounds(rectangle))
                {
                    currentUpdate = Update_Nothing;
                    this.blob.AddComponent(new Falling(Fell, this, 2));
                }
            }

            if (velocity.LengthSquared() < 10)
            {
                currentUpdate = Update_OnGround;
                //blob.AddComponent(new FadeInSeconds(128));
                blob.AddComponent(new DieInSeconds(8));
                color = Color.Lerp(color, Color.Black, .5f);

                LimbPickup pickup = new LimbPickup();
                this.blob.AddComponent(pickup);
            }
        }
Example #3
0
 public void UnregisterLimb(LimbPickup limb)
 {
     if (blobIDs.Contains(limb.blob.ID))
     {
         allLimbs.Remove(limb);
         blobIDs.Remove(limb.blob.ID);
     }
 }