public WorldMap() { locations = new List<Location>() { new Location("Home"), new Location("TownCenter"), new Location("Shop"), new Location("Woods") }; ConnectLocations("Home", "TownCenter"); ConnectLocations("TownCenter", "Shop"); ConnectLocations("TownCenter", "Woods"); AddActions("Home", new List<InteractionAction>() { InteractionActions.ChangeLocation(), InteractionActions.Sleep()}); AddActions("TownCenter", new List<InteractionAction>() { InteractionActions.ChangeLocation()}); AddActions("Shop", new List<InteractionAction>() { InteractionActions.ChangeLocation(), InteractionActions.BuyFromShop() }); AddActions("Woods", new List<InteractionAction>() { InteractionActions.ChangeLocation(), InteractionActions.FightMonsters() }); }
public void PlayerInteraction(InteractionActions interaction) { switch (interaction) { case InteractionActions.Lever: for (int i = 0; i < environmentArray.Length; i++) { if (environmentArray[i].ObjectName == "FallingSpikePlatform") { environmentArray[i].IsOnGround = false; environmentArray[i].IsGravityAffected = true; } } break; default: break; } }