Exemplo n.º 1
0
        /// <summary>
        /// top and bottom boundary check
        /// if a missile goes past gdi boundaries(left and right walls)
        /// then remove them in main form code
        /// </summary>
        /// <param name="arg"></param>
        /// <returns></returns>
        public static bool BoundaryCheckUpDown(missile arg)
        {
            //null check
            if (arg == null)
            {
                return(false);
            }

            // if past gdi walls return its location and have it removed in main
            return((arg.Where().Y < 0) || (arg.Where().Y > _drawer.ScaledHeight));
        }
Exemplo n.º 2
0
        /// <summary>
        /// left and right walls boundary check
        /// if a missile goes past gdi boundaries
        /// then remove them in main form code
        /// </summary>
        /// <param name="foe"></param>
        /// <returns></returns>
        public static bool boundaryCheckLeftRIght(missile foe)
        {
            //null check
            if (foe == null)
            {
                return(false);
            }

            // if past gdi walls return its location and have it removed in main
            return((foe.Where().X < (0 + foe.radius * 2)) || (foe.Where().X > (_drawer.ScaledWidth + foe.radius * 2)));
        }