protected override void OnShown(EventArgs e) { SetNormalViewSize(); LoadGame(CreateGame(_world, _startingPlayer), _world); _world = null; _startingPlayer = null; base.OnShown(e); }
private void LoadGame(TextAdventureGame game, Engine.Objects.World world) { CloseGame(); Text = world.Title + " - Text Adventure"; _game = game; _game.Run(); xnaControl.DrawBackground = false; }
private TextAdventureGame CreateGame(Engine.Objects.World world, Player startingPlayer) { return(new TextAdventureGame( xnaControl.GraphicsDevice, world, startingPlayer, _multimediaPlayer, _fpsConfigurationSection, _logConfigurationSection, _worldTimeConfigurationSection)); }
private void OpenGame(string path) { try { Engine.Objects.World world = WorldLoader.Instance.FromAssembly(path); LoadGame(CreateGame(world, world.StartingPlayer), world); } catch (Exception exception) { MessageBoxHelper.Instance.ShowError(this, String.Format("Error opening game:{0}{0}{1}", Environment.NewLine, exception.Message)); } }
private static void Main() { Engine.Objects.World world = GetWorld(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); var gameForm = new GameForm(world, world.StartingPlayer); Application.Idle += (sender, args) => ApplicationOnIdle(gameForm); Application.Run(gameForm); SoundSystem.Instance.Release(); }
public GameForm(Engine.Objects.World world, Player startingPlayer) { world.ThrowIfNull("world"); startingPlayer.ThrowIfNull("startingPlayer"); _world = world; _startingPlayer = startingPlayer; _multimediaPlayer = new MultimediaPlayer(_volumeConfigurationSection); InitializeComponent(); SetNormalViewSize(); fpsToolStripMenuItem.Checked = _fpsConfigurationSection.Visible; logToolStripMenuItem.Checked = _logConfigurationSection.Visible; worldTimeToolStripMenuItem.Checked = _worldTimeConfigurationSection.Visible; soundEffectsToolStripMenuItem.Checked = true; musicToolStripMenuItem.Checked = true; }
public TextAdventureGame( GraphicsDevice graphicsDevice, Engine.Objects.World world, Player player, IMultimediaPlayer multimediaPlayer, IFpsConfiguration fpsConfiguration, ILogConfiguration logConfiguration, IWorldTimeConfiguration worldTimeConfiguration) : base(graphicsDevice, new ContentDirectoryContentManagerProvider()) { world.ThrowIfNull("world"); player.ThrowIfNull("player"); multimediaPlayer.ThrowIfNull("multimediaPlayer"); fpsConfiguration.ThrowIfNull("fpsConfiguration"); logConfiguration.ThrowIfNull("logConfiguration"); worldTimeConfiguration.ThrowIfNull("worldTimeConfiguration"); _world = world; _player = player; _multimediaPlayer = multimediaPlayer; _fpsConfiguration = fpsConfiguration; _logConfiguration = logConfiguration; _worldTimeConfiguration = worldTimeConfiguration; }