Пример #1
0
        public void SetRiceCoin(bool[] riceCoin)
        {
            string txt = "";

            foreach (bool rice in riceCoin)
            {
                if (rice)
                {
                    txt += "1,";
                }
                else
                {
                    txt += "0,";
                }
            }
            txt = txt.Substring(0, txt.Length - 1);
            string data = readFile.SearchData();

            string[] help = data.Split('|');
            help[3] = txt;
            string erg = "";

            for (int f = 0; f < help.Length - 1; f++)
            {
                erg += help[f] + "|";
            }
            readFile.SetData(erg);
        }
Пример #2
0
        public Play(string level, Settings settings, Worlds worlds)
        {
            allDone.Reset();
            InitializeComponent();
            Sound_music.CheckMusic(settings);
            Visible  = false;
            readFile = new ReadFile(level);
            string[]     data          = readFile.SearchData().Split('|');
            LoadingLevel loadingScreen = new LoadingLevel("Level " + level, data[0].Split('#')[1], data[1], data[3]);

            loadingScreen.Show();
            new Thread(LoadingScreen).Start();

            this.level      = level;
            this.worlds     = worlds;
            FormBorderStyle = FormBorderStyle.None;
            WindowState     = FormWindowState.Maximized;
            this.settings   = settings;
            engine          = new Engine(readFile.InterpretFile(settings), Controls);

            allDone.WaitOne();
            Visible = true;
            loadingScreen.Close();

            Focus();
            engine.Start();
        }
Пример #3
0
        public static void ResetLevel(ReadFile readFile, string four)
        {
            string[] help = readFile.SearchData().Split('|');
            help[1] = "-1";
            help[3] = "0,0,0";
            help[4] = four;
            string setdata = "";

            for (int f = 0; f < help.Length - 1; f++)
            {
                setdata += help[f] + "|";
            }
            setdata += help[help.Length - 1];
            readFile.SetData(setdata);
        }