Exemple #1
0
        public static void Init(Form2048 _form)
        {
            r                       = new Random();
            form                    = _form;
            animationPlaying        = false;
            tickRate                = 10;
            animationTimer          = new Timer();
            animationTimer.Interval = 20;
            animationTimer.Tick    += GameLoop;
            animationTimer.Start();

            ticksToMove = 0;
            toDraw      = new List <Tile>();
            toMove      = new List <Tile>();
            toDelete    = new List <Tile>();
            n           = 4; m = 4;

            for (int i = 0; i < n; i++)
            {
                tileMat = new Tile[n][];
                for (int j = 0; j < m; j++)
                {
                    tileMat[j] = new Tile[m];
                }
            }
            sound.URL = Path.GetFullPath(@"..\..\..\Sounds\level_up.mp3");
        }
Exemple #2
0
 public new static void Close()
 {
     Form2048.Close();
 }