示例#1
0
        public MiswGame2007Application()
        {
            {
                FileArchiverZip zip = new FileArchiverZip();
                zip.ZipExtName = ".btw";
                FileSys.Archiver.Add(zip);
            }
            UnmanagedResourceManager.Instance.VideoMemory.LimitSize = 64 * 1024 * 1024;
            settings = new Settings("settings.cfg");
            CreateWindow(settings.Fullscreen);
            inputDevice = new InputDevice(!settings.Fullscreen, settings.JumpButton, settings.AttackButton, settings.StartButton);
            graphicsDevice = new GraphicsDevice(window);
            audioDevice = new AudioDevice();
            LoadStageData();

            title = new TitleScene(0, settings.ArcadeMode);
            title.AudioDevice = audioDevice;
            currentState = State.Title;
            currentStageIndex = settings.StartStageIndex;
            if (settings.StartStageIndex < settings.NumUnlockedStages)
            {
                numUnlockedStages = settings.NumUnlockedStages;
            }
            else
            {
                numUnlockedStages = settings.StartStageIndex + 1;
            }

            if (numUnlockedStages < 25)
            {
                numUnlockedStages = 25;
            }

            log = null;
            if (settings.ArcadeMode)
            {
                for (int i = 1; i <= 9999; i++)
                {
                    if (!File.Exists("log" + (10000 + i).ToString().Substring(1) + ".txt"))
                    {
                        log = new StreamWriter("log" + (10000 + i).ToString().Substring(1) + ".txt");
                        break;
                    }
                }
            }
        }
示例#2
0
        public MiswGame2008(bool fullscreen, int startLevel)
        {
            FileArchiverZip zip = new FileArchiverZip();
            zip.ZipExtName = ".bin";
            FileSys.AddArchiver(zip);
            window = new SDLWindow();
            window.SetCaption("DTF");
            window.BeginScreenTest();
            if (fullscreen)
            {
                window.TestVideoMode(640, 480, 32);
                window.TestVideoMode(640, 480, 16);
            }
            else
            {
                window.TestVideoMode(640, 480, 0);
            }
            window.EndScreenTest();
            graphics = new SdlGraphics(window);
            audio = new SdlAudio();
            input = new SdlInput(fullscreen);

            this.startLevel = startLevel;
        }