// overrides drawable update method to update attributes of powerup, such as position and depth public override void Update(GameTime gameTime) { if (isOn) { engine.attributes.depth = attributes.depth; float x = attributes.position.X + (float)(random.NextDouble() - .5) * attributes.width; float y = attributes.position.Y + (float)(random.NextDouble() - .5) * attributes.height; engine.attributes.position = new Vector2(x, y); engine.Update(gameTime); base.Update(gameTime); } }