예제 #1
0
        private Thread CreateInputListenerThread(bool useXinput)
        {
            IntPtr hWnd        = new WindowInteropHelper(Application.Current.MainWindow).EnsureHandle();
            var    inputThread = new Thread(() => _inputListener.Listen(_parrotData.UseSto0ZDrivingHack, _parrotData.StoozPercent, _gameProfile.JoystickButtons, useXinput, _gameProfile, hWnd));

            inputThread.Start();
            return(inputThread);
        }
예제 #2
0
        private Thread CreateInputListenerThread(bool useXinput)
        {
            var hWnd = new WindowInteropHelper(Application.Current.MainWindow ?? throw new InvalidOperationException())
                       .EnsureHandle();
            var inputThread = new Thread(() => InputListener.Listen(Lazydata.ParrotData.UseSto0ZDrivingHack,
                                                                    Lazydata.ParrotData.StoozPercent, _gameProfile.JoystickButtons, useXinput, _gameProfile));

            inputThread.Start();
            return(inputThread);
        }
예제 #3
0
파일: Game.cs 프로젝트: regaleagle/TagWars
    void Update()
    {
        if (!IsGameOver())
        {     // if there is no CountDown
            if (!ui.CountDown())
            { // checks game over
                IsGameOver();
                if (cardHolder.IsReleaseOver())
                {     // if the release animation is over
                    if (!cardHolder.IsCanceled())
                    { // & attack is not canceled: deal damage
                        int damage = cardHolder.TotalDamage();
                        opponent.UpdateHealth(damage);
                        photonView.RPC("UpdateHealth", PhotonTargets.Others, damage);
                        player.lastDamage = damage;
                        ui.UpdateOpponentHealthBar(opponent.health);
                    }
                    // init cardholder with a card
                    cardHolder.Init();
                    ui.NewTagCloud();
                }

                // if some card is active
                if (cardHolder.IsInputReady())
                {   // listen to input
                    InputListener.Listen(true);
                    if (Input.GetKeyDown("return") && cardHolder.IsReleaseReady())
                    {
                        InputListener.Listen(false);
                        string newTag = InputListener.GetInput();
                        if (player.lastTag == "")
                        {
                            player.lastTag = "nothing_here";
                        }
                        StartCoroutine(QueryManager.QueryDamageDistribution(newTag, player.lastTag, player.lastDamage, OnResponce));
                        ui.RemoveTagCloud();
                        player.lastTag = newTag;
                    }
                }
                else
                {   // Cancel or Release attack
                    cardHolder.HandleAttack();
                }
            }
        }
        else
        {
            gameOver = true;
            if (!disconnected)
            {
                photonView.RPC("GameOver", PhotonTargets.All);
            }
            else
            {
                if (ui.ExitGame() || ui.concede)
                {
                    Application.LoadLevel("MainMenu");
                }
            }
        }
    }