Exemple #1
0
 public virtual void OnCollisionWithStaticGameObject(StaticGameObject staticGameObject)
 {
     if (this.GetPositionX() < staticGameObject.GetPositionX() &&
         this.GetPositionY() < (staticGameObject.GetPositionY() + staticGameObject.GetOriginY()) &&
         this.GetPositionY() > (staticGameObject.GetPositionY() - staticGameObject.GetOriginY()))
     {
     }
 }
Exemple #2
0
 public virtual void OnCollisionWithStaticGameObject(StaticGameObject staticGameObject)
 {
     if (this.GetPositionX() < staticGameObject.GetPositionX() &&
         this.GetPositionY() < (staticGameObject.GetPositionY() + staticGameObject.GetOriginY()) &&
         this.GetPositionY() > (staticGameObject.GetPositionY() - staticGameObject.GetOriginY()))
     {
     }
 }
        public void AddStaticGameObject(StaticGameObject staticGameObject)
        {
            IEnumerator<StaticGameObject> staticEnumerator = _staticGameObjects.GetEnumerator();

            bool exists = false;

            while (staticEnumerator.MoveNext())
            {
                if (staticEnumerator.Current == staticGameObject)
                {
                    exists = true;
                }
            }

            if (!exists)
            {
                _staticGameObjects.Add(staticGameObject);
            }
        }