Example #1
0
        public static void InitState()
        {
            String ScoreFolder = Path.Combine
                                     (Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                     "BASeTris");

            if (!Directory.Exists(ScoreFolder))
            {
                Directory.CreateDirectory(ScoreFolder);
            }



            String ScoreFile = Path.Combine(ScoreFolder, "hi_score.xml");

            ScoreMan = XMLScoreManager <TetrisHighScoreData> .FromFile(ScoreFile);

            if (ScoreMan == null)
            {
                ScoreMan = new XMLScoreManager <TetrisHighScoreData>(ScoreFile);
            }
            String ApplicationFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            String AssetsFolder      = Path.Combine(ApplicationFolder, "Assets");

            Imageman = new ImageManager(TetrisGame.GetSearchFolders());

            String[] AudioAssets = (from s in TetrisGame.GetSearchFolders() select Path.Combine(s, "Audio")).ToArray();
            var      Driver      = new BASSDriver();

            Soundman = new cNewSoundManager(Driver, AudioAssets);

            RetroFont   = GetResourceFont("BASeTris.Pixel.ttf");
            LCDFont     = GetResourceFont("BASeTris.LCD.ttf");
            RetroFontSK = GetResourceFontSK("BASeTris.Pixel.ttf");
            LCDFontSK   = GetResourceFontSK("BASeTris.LCD.ttf");
            ArialFontSK = SKTypeface.FromFamilyName("Arial");
            //RetroFont = pfc.Families[0];
        }
Example #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

               // ac = new AudioContext();
               // xram = new XRamExtension();
            SoundMan= new cNewSoundManager(new BASSDriver(), new []{new DirectoryInfo(GetSoundFolder())});

            GL.ClearColor(Color.Gray);
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.Texture2D);
            currentState = new GameRunningState(this);

            TextureMan = new TextureManager(new DirectoryInfo[] { new DirectoryInfo(GetImageFolder()) });
               // SoundMan = new SoundManager(hnd,new DirectoryInfo[] { new DirectoryInfo(GetSoundFolder()) });

            //BlockTexture = LoadTexture(@"D:\testtexture.png");
            //BlockTexture2 = LoadTexture(@"D:\testtexture2.png");
            TextureMan.WaitonSearchComplete();
        }