/// <summary> /// Will begin a new game /// </summary> public DynGame(DynGameOptions gameOptions, ContentManager Content) { setGameOptions(gameOptions); //----------------------------------------------- //Create lists playerTextures = new List<Texture2D>(); deathTextures = new List<Texture2D>(); players = new List<DynPlayer>(); monsters = new List<DynMonster>(); bombs = new List<DynBomb>(); explosions = new List<DynExplosion>(); monsterTextures = new List<Texture2D>(); monsterDeathTextures = new List<Texture2D>(); //----------------------------- //Create objects board = new DynBoard(); playersStartingPositions = new List<Vector2>(); //Initial positions for players playersStartingPositions.Add(new Vector2(10, 10)); playersStartingPositions.Add(new Vector2(boardSize * 16 - 10, 10)); playersStartingPositions.Add(new Vector2(10, boardSize * 16 - 10)); playersStartingPositions.Add(new Vector2(boardSize * 16 - 10, boardSize * 16 - 10)); LoadContent(Content); StartGame(); }
SpriteBatch spriteBatch; // kontener obrazkow do rysowania #endregion Fields #region Constructors public DynaBomber() { fileManager.iniFile(settingsFileName); //Initialization of file with settings gameOptions = new DynGameOptions( //Loads options to gameOptions object Int32.Parse(fileManager.GetString("Game", "BoardSize", "(none)")), Int32.Parse(fileManager.GetString("Game", "PlayerNumber", "(none)")), Int32.Parse(fileManager.GetString("Game", "MonsterNumber", "(none)")) ); //Graphics initialization graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = gameOptions.boardSize * 16; graphics.PreferredBackBufferHeight = gameOptions.boardSize * 16; graphics.IsFullScreen = false; graphics.ApplyChanges(); Content.RootDirectory = "Content"; }
public void setGameOptions(DynGameOptions gameOptions) { playerNumber = gameOptions.playerNumber; monsterNumber = gameOptions.monsterNumber; boardSize = gameOptions.boardSize; settingsFileName = gameOptions.settingsFileName; }