Ejemplo n.º 1
0
        /*
         * Method which determines if the snake has reached the item
         * */
        public Boolean IsReached(SnakePart snake)
        {
            Boolean isReached = false;

            if ((snake.Get_X() == _X) && (snake.Get_Y() == _Y))
                isReached = true;

            return isReached;
        }
Ejemplo n.º 2
0
        /*
         * Method which determines if the snake has reached the insect
         */
        public Boolean IsReached(SnakePart snakePart)
        {
            Boolean isReached = false;

            if (((snakePart.Get_X() == _X) && (snakePart.Get_Y() == _Y)) || ((snakePart.Get_X() == (_X + (_Side / 2 + 1))) && (snakePart.Get_Y() == _Y)) || ((snakePart.Get_X() == _X) && (snakePart.Get_Y() == (_Y + (_Side / 2) + 1))) || ((snakePart.Get_X() == (_X + (_Side / 2 + 1))) && (snakePart.Get_Y() == (_Y + (_Side / 2) + 1))))
                isReached = true;

            return isReached;
        }