public void Execute(IGameObject gameObject1, IGameObject gameObject2) { IMario mario = (IMario)gameObject1; if (mario.State.MarioShape == MarioState.MarioShapeEnums.Dead) { return; } IItem mush = (IItem)gameObject2; if (!mush.IsCollected) { mush.Collect(); switch (mario.State.MarioShape) { case MarioState.MarioShapeEnums.Small: GameUtilities.GameObjectManager.MarioTransition(mario.State.MarioShape, MarioState.MarioShapeEnums.Big, mario); break; case MarioState.MarioShapeEnums.StarSmall: GameUtilities.GameObjectManager.MarioTransition(mario.State.MarioShape, MarioState.MarioShapeEnums.StarBig, mario); mario.PreStarShape = MarioState.MarioShapeEnums.Big; break; } } }
public void Execute(IGameObject gameObject1, IGameObject gameObject2) { IMario mario = (IMario)gameObject1; if (mario.State.MarioShape == MarioState.MarioShapeEnums.Dead) { return; } IItem mush = (IItem)gameObject2; if (!mush.IsCollected) { mush.Collect(); } }
public void Execute(IGameObject gameObject1, IGameObject gameObject2) { IMario mario = (IMario)gameObject1; if (mario.State.MarioShape == MarioState.MarioShapeEnums.Dead) { return; } IItem star = (IItem)gameObject2; if (!star.IsCollected) { star.Collect(); if (mario.State.MarioShape != MarioState.MarioShapeEnums.StarSmall && mario.State.MarioShape != MarioState.MarioShapeEnums.StarBig) { GameUtilities.GameObjectManager.MarioTransition(mario.State.MarioShape, MarioState.MarioShapeEnums.StarSmall, mario); } } }
public void Handle() { Sounds.GetItemObtainedSound().Play(); item.Collect(player); items.Remove(item); }