public void Update(Player player) { //don't update if it's already been picked up! if (collected) return; bool collision = false; //check for collision with player //if collision if (collision) { collected = true; switch (type) { case GemType.White: //add to score player.AddScore(100); break; case GemType.Red: //add to health player.AddHealth(); break; case GemType.Gold: //refill health and add 1 to max health (Zelda, anyone?) player.AddToMaxHealth(); break; } } }