public override void Process()
 {
     if (FKSettings.GetInstance().MainWindow.GetSpecialKeyStatus(fk_SpecialKey.ENTER, fk_SwitchStatus.DOWN))
     {
         MainFrame.Instance.PushNewScene(new GameMain());
     }
 }
 public static void Update()
 {
     _instance?.InnerUpdate();
     if (FKSettings.GetInstance().MainWindow.GetSpecialKeyStatus(fk_SpecialKey.ENTER, fk_SwitchStatus.DOWN))
     {
         MainFrame.Instance.PopScene(1);
     }
 }
Beispiel #3
0
        protected override void UniqueMove()
        {
            MainFrame.Instance.NowScene.MainScene.EntryModel(_shootLine);
            MainFrame.Instance.NowScene.MainScene.EntryModel(Model);

            var window = FKSettings.GetInstance().MainWindow;

            if (window.GetSpecialKeyStatus(fk_SpecialKey.LEFT, fk_SwitchStatus.PRESS))
            {
                Position.x -= MoveSpeed;
            }
            if (window.GetSpecialKeyStatus(fk_SpecialKey.RIGHT, fk_SwitchStatus.PRESS))
            {
                Position.x += MoveSpeed;
            }
            if (window.GetSpecialKeyStatus(fk_SpecialKey.UP, fk_SwitchStatus.PRESS))
            {
                Position.y += MoveSpeed;
            }
            if (window.GetSpecialKeyStatus(fk_SpecialKey.DOWN, fk_SwitchStatus.PRESS))
            {
                Position.y -= MoveSpeed;
            }

            CorrectPosition();

            _shootLine.GlMoveTo(new fk_Vector(Position.x, Position.y, -ShootLineLength / 2));

            if (window.GetKeyStatus('Z', fk_SwitchStatus.DOWN))
            {
                var normalBullet = new NormalBullet(CharacterSide.Player, new fk_Vector(Position),
                                                    new fk_Vector(0, 0, -2), fk_Material.GrassGreen);
            }

            if (window.GetKeyStatus('X', fk_SwitchStatus.DOWN))
            {
                var normalBullet =
                    new PierceBullet(CharacterSide.Player, new fk_Vector(Position), new fk_Vector(0, 0, -2));
            }

            if (window.GetKeyStatus('C', fk_SwitchStatus.DOWN))
            {
                var normalBullet =
                    new ClusterBullet(CharacterSide.Player, new fk_Vector(Position), new fk_Vector(0, 0, -2));
            }

            if (window.GetKeyStatus('V', fk_SwitchStatus.PRESS))
            {
                var normalBullet = new NormalBullet(CharacterSide.Player, new fk_Vector(Position),
                                                    new fk_Vector(0, 0, -2), fk_Material.HolidaySkyBlue, 1.5);
            }

            if (window.GetKeyStatus('I', fk_SwitchStatus.DOWN))
            {
                _isImmotal = !_isImmotal;
            }
        }
 public static bool Create(fk_AppWindow mainWindow, fk_AppWindow stateWindow, bool force = false)
 {
     if (_instance != null && !force)
     {
         return(false);
     }
     _instance = new FKSettings(mainWindow, stateWindow);
     return(true);
 }
        public void MainLoop(string mainWindowName, fk_Dimension mainSize, string stateWindowName,
                             fk_Dimension stateSize, SceneBase firstScene)
        {
            fk_Material.InitDefault();
            FKSettings.Create(new fk_AppWindow
            {
                Size       = mainSize,
                BGColor    = fk_Material.MatBlack.Diffuse,
                Scene      = { BlendStatus = true },
                WindowName = mainWindowName,
            }, new fk_AppWindow
            {
                Size       = stateSize,
                BGColor    = fk_Material.DarkBlue.Diffuse,
                WindowName = stateWindowName,
            });
            PushNewScene(firstScene);

            FKSettings.WindowOpen();
            while (FKSettings.Update())
            {
                _sceneStack.Peek().Run();
            }
        }
 private void SetFkScene()
 {
     FKSettings.GetInstance().MainWindow.SetScene(_sceneStack.Peek().MainScene, false);
     FKSettings.GetInstance().StateWindow.SetScene(_sceneStack.Peek().StateScene, false);
 }