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); }
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); }
protected override void OnUpdateFrame(FrameEventArgs e) { if (Running == false) { Game = null; this.Exit(); return; } if (Game == null) return; Game.Update((float)e.Time); if (Keyboard[Key.AltLeft] && Keyboard[Key.Enter]) { if (this.WindowState == WindowState.Fullscreen) this.WindowState = WindowState.Normal; else this.WindowState = WindowState.Fullscreen; } }
public static void SetGame(GameClass game) { if (Game != null) Game.Dispose(); Game = game; if (game != null) game.Init(); }