示例#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);
        }
示例#2
0
 public MySound(int _id, string p, bool _loop = false)
 {
     path = p;
     id   = _id;
     loop = _loop;
     BGSnakeCJsInterop.InitializeSound(id, path, loop);
 }
示例#3
0
        public static void Game_Over()
        {
            if (Is_Enabled_Audio)
            {
                SoundEffect.bg_sound.pause();
                SoundEffect.game_over.play();
            }

            timer.Dispose();
            BGSnakeCJsInterop.Alert("Game Over");
        }
示例#4
0
 public void pause()
 {
     BGSnakeCJsInterop.ManageSound(id, "pause");
 }
示例#5
0
 public void play()
 {
     BGSnakeCJsInterop.ManageSound(id, "play");
 }