Update() private method

private Update ( ) : void
return void
コード例 #1
0
ファイル: World.cs プロジェクト: tvhoustontv/Pacman
        public void Update(RenderWindow target, float time)
        {
            if (_tileMap.Coins < 1)
            {
                _worldState = WorldState.Win;
            }

            if ((_worldState != WorldState.GameOver) && (_worldState != WorldState.Win))
            {
                _player.Update(_tileMap);
                _blinky.Update(_tileMap, _player, time);
                _pinky.Update(_tileMap, _player, time);
                _inky.Update(_tileMap, _player, time);
                _clyde.Update(_tileMap, _player, time);
            }
        }
コード例 #2
0
        protected virtual void UpdateGhost(Ghost ghost)
        {
            //only update movement if agent did not just lost a life
            if (this.agentLostLife)
            {
                return;
            }

            //checks if ghosts are able to cross magic door
            if (this.CheckMagicDoor(ghost))
            {
                return;
            }

            //update ghosts normally
            ghost.Update();
        }
コード例 #3
0
ファイル: TestsPacman.cs プロジェクト: Malpp/TP2-Pacman
        public void TestMoveValid02()
        {
            // Mise en place des données
            Grid grid = new Grid();

            Pacman.Pacman pacman = new Pacman.Pacman(11, 14);
            Ghost         ghost  = new Ghost(GhostNames.blinky);

            // Appel de la méthode à tester
            ghost.Update(0, grid, pacman, GhostNames.blinky);

            // Validation des résultats
            Assert.AreEqual(true, pacman.ChangeDirection(Direction.Left, grid));


            // Clean-up
        }
コード例 #4
0
ファイル: Main.cs プロジェクト: Epidra/GameCenter
        protected override void Update(GameTime gameTime)
        {
            if (!loaded_banner)
            {
                loaded_banner = true;
                Start_AdBanner();
                if (Filemanager.lizenz != null)
                {
                    Change_AdBanner();
                }
                orientation = DisplayOrientation.Unknown;

#if (!DEBUG)
                if (Filemanager.lizenz.ProductLicenses["MalGC_Werbung"].IsActive)
                {
                    Change_AdBanner();
                }
#endif
            }
            if (orientation != Window.CurrentOrientation)
            {
                orientation = Window.CurrentOrientation;
                if (orientation == DisplayOrientation.LandscapeLeft)
                {
                    Shopkeeper.orientation = 1;
                }
                if (orientation == DisplayOrientation.LandscapeRight)
                {
                    Shopkeeper.orientation = 2;
                }
                if (orientation == DisplayOrientation.Portrait)
                {
                    Shopkeeper.orientation = 3;
                }
                if (orientation == DisplayOrientation.PortraitDown)
                {
                    Shopkeeper.orientation = 4;
                }
                if (Filemanager.lizenz != null)
                {
                    Change_AdBanner();
                }
                if (Shopkeeper.orientation == 2)
                {
                    adControl_X_L.BorderThickness = new Thickness(0, -marginDown / 3 * 2, -marginLeft / 3 * 2, 0);
                }
                else
                {
                    adControl_X_L.BorderThickness = new Thickness(-marginLeft / 3 * 2, -marginDown / 3 * 2, 0, 0);
                }
                Shopkeeper.Load_Info();
            }

            if (Shopkeeper.orientation <= 2)
            {
                if (screen_width_scale != ((float)Window.ClientBounds.Width / (float)screen_width) || screen_height_scale != ((float)Window.ClientBounds.Height / (float)screen_height))
                {
                    MasterMenu.Resize(((float)Window.ClientBounds.Width / (float)screen_width), ((float)Window.ClientBounds.Height / (float)screen_height));
                    MasterDebug.Resize(((float)Window.ClientBounds.Width / (float)screen_width), ((float)Window.ClientBounds.Height / (float)screen_height));
                    for (int i = 0; i < MasterGame.Length; i++)
                    {
                        MasterGame[i].Resize(((float)Window.ClientBounds.Width / (float)screen_width), ((float)Window.ClientBounds.Height / (float)screen_height));
                    }
                }
            }
            else
            {
                if (screen_width_scale != ((float)Window.ClientBounds.Width / (float)screen_height) || screen_height_scale != ((float)Window.ClientBounds.Height / (float)screen_width))
                {
                    MasterMenu.Resize(((float)Window.ClientBounds.Width / (float)screen_height), ((float)Window.ClientBounds.Height / (float)screen_width));
                    MasterDebug.Resize(((float)Window.ClientBounds.Width / (float)screen_height), ((float)Window.ClientBounds.Height / (float)screen_width));
                    for (int i = 0; i < MasterGame.Length; i++)
                    {
                        MasterGame[i].Resize(((float)Window.ClientBounds.Width / (float)screen_height), ((float)Window.ClientBounds.Height / (float)screen_width));
                    }
                }
            }
            string temp = "";
            if (active_screen == -1)
            {
                temp = MasterMenu.Update(gameTime);
            }
            else if (active_screen == -2)
            {
                temp = MasterDebug.Update(gameTime);
            }
            else
            {
                temp = MasterGame[active_screen].Update(gameTime);
            }

            if (temp == "menu")
            {
                active_screen = -1;
            }
            if (temp == "debuggame")
            {
                active_screen = -2;
            }

            if (temp == "MalGC_Werbung")
            {
                Change_AdBanner();
            }

            if (temp == "gamestart")
            {
                active_screen = MasterMenu.current_row_main * 5 + MasterMenu.current_point_main;
                MasterGame[active_screen].Start(gameTime, ConvertDiff(), MasterMenu.active_levelselect);
            }
            base.Update(gameTime);
        }
コード例 #5
0
    void LateUpdate()
    {
        if (Player.AllPlayers.Count == 0)
        {
            Debug.Log("waiting for players");
        }
        else if (TestAbility == null && Player.AllPlayers.Count > 0)
        {
            float LookDamage = 7.5f;
            float AOEDamage  = 7.5f;
            float AOERadius  = 10f;
            float Cooldown   = 10.0f;
            float ActiveTime = 5.0f;

            TestAbility = new Materialise(ThisPlayer, Player.AllPlayers[0], Cooldown, ActiveTime, AOERadius, AOEDamage, LookDamage);
            Debug.Log("setting ability");
        }
        else if (PV.IsMine)
        {
            if (!DoorsDeleted && Door.AllDoors.Count > 0)
            {
                DoorsDeleted = true;

                foreach (KeyValuePair <string, Door> entry in Door.AllDoors)
                {
                    Destroy(entry.Value.GetObject().GetComponent <MeshCollider>());
                    Debug.Log("deleting door colliders");
                }
            }
            if (input.GetKeyDown("escape"))
            {
                if (OldState == null)
                {
                    OldState = ThisPlayer.GetState();
                    ThisPlayer.SetState(PauseMenu);
                    Cursor.lockState = CursorLockMode.None;
                    Cursor.visible   = true;
                    menu.SetActive(true);
                }
                else
                {
                    Resume();
                }
            }
            if (Input.GetKeyDown(KeyCode.N))
            {
                TestAbility.Activate();
            }
            ThisPlayer.Update();
            hotbar.Update();
            input.Update();
            Sheet.SetActive(false);
            MyCamera.SetActive(true);
            MyFBOCam.SetActive(true);
            UIElements.SetActive(true);
            Vector2 Data = Player1Stats.GetData();
            StaminaBar.transform.localScale = new Vector3(Data.y / 100, 1, 1);
            HealthBar.transform.localScale  = new Vector3(Data.x / 100, 1, 1);
            TestAbility.Update(PV);
        }
    }