Exemple #1
0
        public override void Collision(GameObject gameObject, CollisionDetector.CollisionLocation collisionLocation)
        {
            if (gameObject as Ball != null)
            {
                //XDirection = XDirection * -1;
                //YDirection = YDirection * -1;

                switch (collisionLocation)
                {
                case CollisionDetector.CollisionLocation.TopLeft:
                    YDirection = 1;
                    XDirection = 1;
                    break;

                case CollisionDetector.CollisionLocation.TopRight:
                    YDirection = 1;
                    XDirection = -1;
                    break;

                case CollisionDetector.CollisionLocation.BottomLeft:
                    YDirection = -1;
                    XDirection = 1;
                    break;

                case CollisionDetector.CollisionLocation.BottomRight:
                    YDirection = -1;
                    XDirection = -1;
                    break;
                }
            }
        }
 public virtual void Collision(GameObject gameObject, CollisionDetector.CollisionLocation collisionLocation)
 {
 }