Пример #1
0
        public override void Update(float time)
        {
            visibleTime += time;

            if (player.PlayerState == OggPlayerStatus.Stopped)
                player.Play();

            if (tex == -1 || visibleTime > 1)
            {
                if (visibleTime < 100) misses++;

                visibleTime = 0;
                x = Rnd.Next(Settings.Width - 100);
                y = Rnd.Next(Settings.Height - 100);
                tex = Rnd.Next(2);
            }

            // end game. back to menu
            if (Keyboard[Key.Escape])
            {
                GameClass game = new GameMenu();  // menu
                BaseGame.SetGame(game);
                return;
            }

            base.Update(time);
        }
Пример #2
0
        static void Main()
        {
            Log.Create("log.txt");
            Settings.ReadXML("settings.xml");

            int version;
            GraphicsContextFlags flags;
            if (Settings.UseGL3 == false)
            {
                flags = GraphicsContextFlags.Default;
                version = 2;
            }
            else
            {
                flags = GraphicsContextFlags.ForwardCompatible;
                version = 3;
            }
#if DEBUG
            flags |= GraphicsContextFlags.Debug;
#endif

            using (BaseGame bgame = new BaseGame("Project XYZ", version, 0, flags))
            {
                BaseGame.Instance.WindowBorder = OpenTK.WindowBorder.Fixed;

#if !DEBUG
                try
#endif
                {
                    GameClass game = new GameMenu();
                    BaseGame.SetGame(game);
                    bgame.Run(120.0);
                }
#if !DEBUG
                catch (Exception e)
                {
                    Log.WriteLine("Main(): " + e.ToString());
                }
#endif
            }

            Log.WriteLine("Exiting..");
#if DEBUG
            //Console.ReadKey();
#endif
        }