ProjectCow.Cow.Update C# (CSharp) Method

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        public override void Update(GameTime gameTime)
        {
            MoveRandomly(gameTime);
            Move();

            base.Update(gameTime);

            // Remove object after a certain amount of time if it's off screen
            timeAlive += gameTime.ElapsedGameTime;
            if (timeAlive >= MAX_ALIVE_TIME && (Position.X < -Width || Position.X > 720))
                manager.RemoveObject(this);
        }