示例#1
0
        public override void Update()
        {
            if (scrolling)
            {
                if (!player.IsToLeft)
                {
                    if ((int)m_sprite.Width < initialWidth)
                    {
                        m_sprite.SourceRectangle = new Rectangle(0, 0, (int)(m_sprite.Width + comboScrollSpeed), (int)m_sprite.Height);
                    }
                    else
                    {
                        scrolling = false;
                    }
                }
                else
                {
                    if ((int)m_sprite.Width < initialWidth)
                    {
                        m_sprite.SourceRectangle = new Rectangle(m_sprite.SpriteSheet.Texture.Width - (int)(m_sprite.Width + comboScrollSpeed), 0, (int)(m_sprite.Width + comboScrollSpeed), (int)m_sprite.Height);
                    }
                    else
                    {
                        scrolling = false;
                    }
                }
            }

            m_bump.Update();
        }
示例#2
0
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.Exit();
            }

            Globals.kbs = Keyboard.GetState();
            TouchInput.Update();

            if (Globals.kbs.IsKeyDown(Keys.Space) && !cameraMove.IsActive)
            {
                World.cam_Main.Transform.PosY = 0;
                cameraMove.StartPosition      = new Vector2(World.cam_Main.Transform.PosX, 0);
                cameraMove.Target             = World.cam_Main.Transform.Position + new Vector2(0, -350);

                Globals.GameScene.BuildNextLevel();
                Globals.GameScene.StartCurrentLevel();
                Globals.GameScene.StartIntro();

                //cameraZoom.Start();
                //cameraMove.Start();
                //Coin.SpawnCoin(COIN_TYPE.GOLD, Vector2.Zero);
            }
            cameraMove.Update();
            cameraZoom.Update();
            Globals.GameScene.Update();
            World.Update();
        }