示例#1
0
        public override void Update(GameTime gameTime)
        {
            player.Velocity = Vector2.Zero;
            base.Update(gameTime);
            conversationManager.Update(gameTime, ref player);
            player.Update(gameTime, world);
            world.Update(gameTime);
            menuManager.Update(gameTime, ref player);

            camera.LockToSprite(world.CurrentMap.Layer[0], player.Image);
        }
示例#2
0
        public override void Update(GameTime gameTime)
        {
            player.Velocity = Vector2.Zero;
            base.Update(gameTime);
            conversationManager.Update(gameTime, ref player);
            player.Update(gameTime, world);


            world.Update(gameTime);
            menuManager.Update(gameTime, ref player);
            if (moveLeft)
            {
                if (methane.Image.Position.Y > pt1.Y)
                {
                    methane.Image.Position.Y -= 200 * (float)gameTime.ElapsedGameTime.TotalSeconds;
                }
                else if (methane.Image.Position.X > pt2.X)
                {
                    methane.Image.Position.X -= 200 * (float)gameTime.ElapsedGameTime.TotalSeconds;
                }
                else
                {
                    moveLeft = false;
                }
            }
            if (moveUp)
            {
                if (methane.Image.Position.Y > pt3.Y)
                {
                    methane.Image.Position.Y -= 200 * (float)gameTime.ElapsedGameTime.TotalSeconds;
                }
                else
                {
                    moveUp = false;
                }
            }
            if (world.CurrentMapName.Contains("Room1_3") && !moved)
            {
                moveRight = true;
                moved     = true;
                methane.Image.Position.Y = 7 * 128;
                methane.Image.SpriteSheetEffect.CurrentFrame.Y = 0;
            }
            if (moveRight)
            {
                if (methane.Image.Position.Y > pt4.Y)
                {
                    methane.Image.Position.Y -= 200 * (float)gameTime.ElapsedGameTime.TotalSeconds;
                }
                else if (methane.Image.Position.X < pt5.X)
                {
                    methane.Image.Position.X += 200 * (float)gameTime.ElapsedGameTime.TotalSeconds;
                }
                else
                {
                    if (methane.Image.Alpha > 0)
                    {
                        methane.Image.Alpha -= (float)gameTime.ElapsedGameTime.TotalSeconds;
                    }
                    else
                    {
                        methane.Image.Alpha = 0;
                        moveRight           = false;
                    }
                }
            }
            methane.Update(gameTime);
            foreach (SPX spx in spxImage)
            {
                spx.Update(gameTime);
            }

            camera.LockToSprite(world.CurrentMap.Layer[0], player.Image);
        }