Esempio n. 1
0
        public static Board_Element get_Free_Point()
        {
            Board_Element result = new Board_Element();

            bool b = false;

            for (var index = 0; index < points_Count * 10; index++)
            {
                result = Board.Matrix[MyFunctions.get_Random_Int(0, x_Length - 1), MyFunctions.get_Random_Int(0, y_Length - 1)];
                if (result.MyValue == MyValueType.free)
                {
                    if (check_if_one_of_neighbors_if_free(result.Point.x, result.Point.y))
                    {
                        b = true;
                        break;
                    }
                }
            }

            if (!b)
            {
                BGSnakeCJsInterop.Alert("Can't find free point!!!");
            }

            return(result);
        }
Esempio n. 2
0
        public static void Game_Over()
        {
            if (Is_Enabled_Audio)
            {
                SoundEffect.bg_sound.pause();
                SoundEffect.game_over.play();
            }

            timer.Dispose();
            BGSnakeCJsInterop.Alert("Game Over");
        }