General physical properties.
Beispiel #1
0
        public Entity(float x, float y)
#endif
        {
            SetRotation(0);
            mPhysBaby = new PhysicsBaby(this);
            SetTranslation(new Vector2(x, y));
            id = 0; //Zero is a generic id
        }
Beispiel #2
0
        /// <summary>
        /// Add a PhysicsBaby to be managed by the Pharaoh.
        /// </summary>
        /// <param name="physBaby">The PhysicsBaby to add.</param>
        public void AddPhysicsBaby(PhysicsBaby physBaby)
        {
            if (ContentUtil.LoadingBuilders || physBaby == null)
            {
                return;
            }
            physBaby.AddForce(mGravity);

            if (physBaby.IsStatic())
            {
                mStaticBabies.Add(physBaby);
            }
            else
            {
                mDynamicBabies.Add(physBaby);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Remove a PhysicsBaby from the Pharaoh's control.
 /// </summary>
 /// <param name="physBaby">The PhysicsBaby to free.</param>
 public void RemovePhysicsBaby(PhysicsBaby physBaby)
 {
     if (ContentUtil.LoadingBuilders || physBaby == null)
     {
         return;
     }
     if (physBaby.IsStatic())
     {
         mStaticBabies.Remove(physBaby);
     }
     else
     {
         mDynamicBabies.Remove(physBaby);
     }
 }