Exemplo n.º 1
0
        public static void SetGame(GameClass game)
        {
            if (Game != null)
            {
                Game.Dispose();
            }

            Game = game;
            if (game != null)
            {
                game.Init();
            }
        }
Exemplo n.º 2
0
Arquivo: Main.cs Projeto: Keilerr/csat
        public override void Update(float time)
        {
            if (NextTest == true && Keyboard[OpenTK.Input.Key.Escape] == false) // jos testissä painettu ESC
            {
                if (game != null)
                {
                    game.Dispose();
                }

                //testNo = Rnd.Next(5) + 1; // debug

                switch (testNo)
                {
                case 1:
                    game = new Test2D();
                    game.Init();
                    break;

                case 2:
                    game = new TestParticles();
                    game.Init();
                    break;

                case 3:
                    game = new TestPath();
                    game.Init();
                    break;

                case 4:
                    game = new TestAnimation();
                    game.Init();
                    break;

                case 5:
                    game = new TestSoftParticles();
                    game.Init();
                    break;

                case 6:
                    BaseGame.Running = false;
                    game.Dispose();
                    game = null;
                    return;
                }
                testNo++;
                NextTest = false;
            }
            game.Update(time);
            base.Update(time);
        }
Exemplo n.º 3
0
Arquivo: Main.cs Projeto: bosoni/csat
        public override void Update(float time)
        {
            if (NextTest == true && Keyboard[OpenTK.Input.Key.Escape] == false) // jos testissä painettu ESC
            {
                if (game != null) game.Dispose();

                //testNo = Rnd.Next(5) + 1; // debug

                switch (testNo)
                {
                    case 1:
                        game = new Test2D();
                        game.Init();
                        break;
                    case 2:
                        game = new TestParticles();
                        game.Init();
                        break;
                    case 3:
                        game = new TestPath();
                        game.Init();
                        break;
                    case 4:
                        game = new TestAnimation();
                        game.Init();
                        break;
                    case 5:
                        game = new TestSoftParticles();
                        game.Init();
                        break;

                    case 6:
                        BaseGame.Running = false;
                        game.Dispose();
                        game = null;
                        return;
                }
                testNo++;
                NextTest = false;
            }
            game.Update(time);
            base.Update(time);
        }