Update() 공개 메소드

public Update ( ) : void
리턴 void
예제 #1
0
        public override void UpdateParent(GameTime gameTime)
        {
            writer.Update(gameTime);
            Dialogue.Update(gameTime);

            for (int i = children.Count - 1; i >= 0; i--)
            {
                if (children[i].Dead())
                {
                    physical.Remove(children[i] as ICollide);
                    children.RemoveAt(i);
                }
            }

            physical.Collide((float)gameTime.ElapsedGameTime.TotalMilliseconds);

            var kstate = Keyboard.GetState();

            if (kstate.IsKeyDown(Keys.V))
            {
                NextScene = DemoScene2.Instance;
            }

            Color color       = Color.Black;
            float lengthOfDay = 12000;
            float timeOfDay   = (float)gameTime.TotalGameTime.TotalMilliseconds % lengthOfDay / lengthOfDay;

            if (timeOfDay < .25)
            {
                color = Color.MidnightBlue;
            }
            else if (timeOfDay < .375)
            {
                color = Color.Lerp(Color.MidnightBlue, Color.LightSkyBlue, (timeOfDay - .25f) / .125f);
            }
            else if (timeOfDay < .5)
            {
                color = Color.Lerp(Color.LightSkyBlue, Color.White, (timeOfDay - .375f) / .125f);
            }
            else if (timeOfDay < .75)
            {
                color = Color.White;
            }
            else if (timeOfDay < .875)
            {
                color = Color.Lerp(Color.White, Color.Chocolate, (timeOfDay - .75f) / .125f);
            }
            else
            {
                color = Color.Lerp(Color.Chocolate, Color.MidnightBlue, (timeOfDay - .875f) / .125f);
            }
            //Atmosphere = color;
        }