Update() 공개 메소드

public Update ( ) : void
리턴 void
예제 #1
0
        public override void Update()
        {
            if (m_generateAura)
            {
                m_particleGenerator.Update();
            }
            if (m_generateSouls)
            {
                m_soulParticleGenerator.Generate();
                m_soulsToGive--;
                Game1.scoreDisplay.Value += 1;
                if (m_soulsToGive <= 0)
                {
                    Game1.scoreDisplay.Value = Game1.TotalScore;
                    m_generateSouls          = false;
                    m_actionManager.StartNew(m_jumpInMouth);
                }
            }

            m_soulParticles.Update();
            m_auraParticles.Update();

            m_physics.Update();
            m_sword.Update();
            m_cloud.Update();
            m_actionManager.Update();
            //throw new NotImplementedException();
        }
예제 #2
0
        public override void Update(GameTime gameTime)
        {
            MouseState mouse = Mouse.GetState();

            switch (CurrentGameState)
            {
            case GameState.MainMenu:
                if (btnPlay.m_IsClicked)
                {
                    CurrentGameState = GameState.Playing;
                }

                if (btnExplication.m_IsClicked)
                {
                    CurrentGameState = GameState.Option;
                }


                btnPlay.Update(mouse);
                btnExplication.Update(mouse);
                break;

            case GameState.Option: GameScreen.AddScreen(new cExplicationControle(m_ServiceProvider, m_GraphicsDeviceManager));
                GameScreen.RemoveScreen(this);
                break;

            case GameState.Playing: GameScreen.AddScreen(new cMovie1(m_ServiceProvider, m_GraphicsDeviceManager));
                GameScreen.RemoveScreen(this);
                break;
            }

            rain.Update(gameTime, m_GraphicsDeviceManager.GraphicsDevice);
        }
예제 #3
0
 public void Update(GameTime gt)
 {
     if (_appearBadGuy && a == null)
     {
         a = new BadGuy(_position, _scene);
         _scene.GameObjects.AddGameObject("BadGuy", a);
         Particle p = new Particle(new Vector2(0, 0), new Vector2(10, 10), Color.Blue, 3f);
         p.AddComponent("Color", new SinglePixelParticleDrawer(p));
         ColorLerper lerp = (ColorLerper)p.AddComponentAndReturnComponent("lerper", new ColorLerper(p));
         lerp.AddColor(Color.Red, 1f);
         lerp.AddColor(Color.Blue, 1f);
         lerp.AddColor(Color.Yellow, 1f);
         p.AddComponent("Movement", new RandomMovementEffect(p, 15, 20));
         gen                    = new ParticleGenerator(a.Position, new Vector2(-10, 10), new Vector2(-10, 10), 27, p, _scene);
         p.Generator            = gen;
         gen.Enabled            = true;
         gen.IgnoreSafeSpawning = false;
     }
     if (gen != null)
     {
         gen.Update(gt);
         _badguyopacityTime += (float)gt.ElapsedGameTime.TotalSeconds;
         Sprite sprite = (Sprite)a.GetComponents("BadGuySprite").ElementAt(0);
         sprite.Color = Color.White * (_badguyopacityTime / 2f);
         if (_badguyopacityTime > 1.84f)
         {
             gen.Enabled = false;
         }
         if (!gen.particles.Any() && gen.Enabled == false)
         {
             this.Done = true;
         }
     }
     this._scene.Camera.Target = _position;
     _time += (Single)gt.ElapsedGameTime.TotalSeconds;
     if (!(_time >= TimePerMessage))
     {
         return;
     }
     if (Input.IsKeyDown(Keys.Space) || Input.IsKeyDown(Keys.Enter) || Input.IsKeyDown(Keys.Escape))
     {
         if (Input.WasKeyUp(Keys.Space))
         {
             Finish();
             return;
         }
         if (Input.WasKeyUp(Keys.Enter))
         {
             Finish();
             return;
         }
         if (Input.WasKeyUp(Keys.Escape))
         {
             Finish();
             return;
         }
     }
 }