当前位置: 首页>>代码示例>>C#>>正文


C# Controls.accept方法代码示例

本文整理汇总了C#中Controls.accept方法的典型用法代码示例。如果您正苦于以下问题:C# Controls.accept方法的具体用法?C# Controls.accept怎么用?C# Controls.accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Controls的用法示例。


在下文中一共展示了Controls.accept方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        public void Update(GameTime gameTime, Controls _controls)
        {
            menuChoosen = false;

            if(_controls.menuUp() || _controls.menuRight())
            {
                menuItem++;
            }
            if (_controls.menuDown() || _controls.menuLeft())
            {
                menuItem--;
            }

            if (_controls.pause())
            {
                menuChoosen = true;
                menuItem = 1;
            }

            if (_controls.accept())
            {
                menuChoosen = true;
            }

            if (menuItem > 2)
                menuItem = 1;
            if (menuItem < 1)
                menuItem = 2;

            pauseSprite.Update(gameTime, menuItem);

            if (menuChoosen)
            {
                pauseSprite.IsVisible = false;
            }
        }
开发者ID:CWentz,项目名称:ParasiteParadiseOriginal,代码行数:36,代码来源:PauseScreen.cs

示例2: Update

        public void Update(Controls _controls, GameTime gameTime)
        {
            animation.Update(gameTime);

            menuChoosen = false;
            if (_controls.menuUp())
            {
                menuItem--;
            }

            if (_controls.menuDown())
            {
                menuItem++;
            }

            if (menuItem > 4)
                menuItem = 1;
            if (menuItem < 1)
                menuItem = 4;

            if (_controls.accept())
                menuChoosen = true;
        }
开发者ID:CWentz,项目名称:ParasiteParadiseOriginal,代码行数:23,代码来源:StartScreen.cs

示例3: Update

        public void Update(Controls playerController, GameTime gameTime)
        {
            //added by chad
            if (savingState != SavingState.NotSaving)
            {
                UpdateSave();
            }

            if (handleTimer)
            {
                if (timer > 0)
                    timer--;
                else { step += 1; handleTimer = false; }

                if (step > 5)
                    step = 5;
            }
            else
            {

                if (step == 1)
                {
                    liveHandle = true;
                    if (liquidHeight < (((livePercent / 100f) * 420f)))
                    {
                        liquidHeight += 1.0f;
                    }
                    else { handleTimer = true; collectiblesHandle = true; timer = 60; }
                }

                if (step == 2)
                {
                    if (liquidHeight < (((livePercent / 100f) * 420f) + ((collectiblesPercent / 100f) * 420f)))
                    {
                        liquidHeight += 1.0f;
                    }
                    else { handleTimer = true; scoreHandle = true; timer = 60; }
                }

                if (step == 3)
                {
                    if (liquidHeight < (((livePercent / 100f) * 420f) + ((collectiblesPercent / 100f) * 420f) + ((scorePercent / 100f) * 420f)))
                    {
                        liquidHeight += 1.0f;
                    }
                    else { handleTimer = true; killsHandle = true; timer = 60; }
                }

                if (step == 4)
                {
                    if (liquidHeight < (((livePercent / 100f) * 420f) + ((collectiblesPercent / 100f) * 420f) + ((scorePercent / 100f) * 420f) + ((killPercent / 100f) * 420f)))
                    {
                        liquidHeight += 1.0f;
                    }
                    else { handleTimer = true; timeHandle = true; timer = 60; }
                }

                if (step == 5 && lives > 0)
                {
                    if (liquidHeight < (((livePercent / 100f) * 420f) + ((collectiblesPercent / 100f) * 420f) + ((scorePercent / 100f) * 420f) + ((killPercent / 100f) * 420f) + ((timePercent / 100f) * 420f)))
                    {
                        liquidHeight += 1.0f;
                    }
                    else
                        if (newHighScoreHandle)
                            highScoreHandle = true;

                }
            }

            totalPercent = Math.Round((liquidHeight / 420f) * 100f) + "";

            if (liveHandle)
                liveScoreboard.Update(true);

            if (collectiblesHandle)
                collectiblesScoreboard.Update();

            if (scoreHandle)
                scoreScoreboard.Update();

            if (killsHandle)
                killScoreboard.Update();

            if (timeHandle)
                timeScoreboard.Update();

            if (highScoreHandle)
                if(lives == 0)
                    newHighScore.Update(true, true, true);
                else
                    newHighScore.Update(true, true);

            if (playerController.accept() && errorFreeSave)
                if (lives == 0)
                    sameLevel = true;
                else
                    nextLevel = true;

               updatePercent = ((liquidHeight*100f) / 420f);
//.........这里部分代码省略.........
开发者ID:CWentz,项目名称:ParasiteParadiseOriginal,代码行数:101,代码来源:ScoreBoard.cs

示例4: Update


//.........这里部分代码省略.........
            level3Pos = new Vector2(2000, 0);
            level4Pos = new Vector2(2000, 0);
            level5Pos = new Vector2(2000, 0);
            level6Pos = new Vector2(2000, 0);
            level7Pos = new Vector2(2000, 0);

            switch (selected)
            {
                case 0:
                    {
                        level0Size = maxScale;
                        level0Pos = new Vector2(0, 0);
                        level1Pos = new Vector2(410, 76);
                    }
                    break;
                case 1:
                    {
                        level1Size = maxScale;
                        level0Pos = new Vector2(-210, 76);
                        level1Pos = new Vector2(0, 0);
                        level2Pos = new Vector2(410, 76);
                    }
                    break;
                case 2:
                    {
                        level2Size = maxScale;
                        level1Pos = new Vector2(-210, 76);
                        level2Pos = new Vector2(0, 0);
                        level3Pos = new Vector2(410, 76);
                    }
                    break;
                case 3:
                    {
                        level3Size = maxScale;
                        level2Pos = new Vector2(-210, 76);
                        level3Pos = new Vector2(0, 0);
                        level4Pos = new Vector2(410, 76);
                    }
                    break;
                case 4:
                    {
                        level4Size = maxScale;
                        level3Pos = new Vector2(-210, 76);
                        level4Pos = new Vector2(0, 0);
                        level5Pos = new Vector2(410, 76);
                    }
                    break;
                case 5:
                    {
                        level5Size = maxScale;
                        level4Pos = new Vector2(-210, 76);
                        level5Pos = new Vector2(0, 0);
                        level6Pos = new Vector2(410, 76);
                    }
                    break;
                case 6:
                    {
                        level6Size = maxScale;
                        level5Pos = new Vector2(-210, 76);
                        level6Pos = new Vector2(0, 0);
                        level7Pos = new Vector2(410, 76);
                    }
                    break;
                case 7:
                    {
                        level7Size = maxScale;
                        level6Pos = new Vector2(-210, 76);
                        level7Pos = new Vector2(0, 0);

                    }
                    break;

                default: break;
            }

            if (key.accept() && timer == 0)
            {
                if (selected == 0)
                    menuChoosen = true;
                if (selected == 1 && level0Percent > 0)
                    menuChoosen = true;
                if (selected == 2 && level1Percent > 0)
                    menuChoosen = true;
                if (selected == 3 && level2Percent > 0)
                    menuChoosen = true;
                if (selected == 4 && level3Percent > 0)
                    menuChoosen = true;
                if (selected == 5 && level4Percent > 0)
                    menuChoosen = true;
                if (selected == 6 && level5Percent > 0)
                    menuChoosen = true;
                if (selected == 7 && level6Percent > 0)
                    menuChoosen = true;

                timer = 30;
            }

            if (timer > 0)
                timer--;
        }
开发者ID:CWentz,项目名称:ParasiteParadiseOriginal,代码行数:101,代码来源:SaveLoadScreen.cs


注:本文中的Controls.accept方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。