public void CreateGame(String fileName) { parser = new TajParser(); GameEnded = false; flashLight = false; GameLost = false; if(fileName.IndexOf("Levels" + Path.DirectorySeparatorChar) != 0) { fileName = "Levels" + Path.DirectorySeparatorChar + fileName; } //code to load in world world = new WorldRenderer(SaveFileSystem.LoadObjectFromFile<World>(fileName, new GameLoader())); this.parser.SetCustomHandler(this); game = new ClassicTetrisGame(); game.SetEventLink(this); parser.Parse(Start); }
public void SetFileName(string p) { this.fileName = p; this.world = new WorldRenderer(SaveFileSystem.LoadObjectFromFile<World>(fileName, new GameLoader())); }
public void SetWorld(World p) { this.world = new WorldRenderer(p); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); fontHandler = new FontHandler(); Logger.Load(); mainMenu = new WorldRenderer(SaveFileSystem.LoadObjectFromFile<World>("Levels/MainMenuLevel.taj", new GameLoader())); optionsMenu = new WorldRenderer(SaveFileSystem.LoadObjectFromFile<World>("Levels/OptionMenuLevel.taj", new GameLoader())); fontHandler.LoadContent(Content); SoundEffectInstance song =Content.Load<SoundEffect>("NewTetris").CreateInstance(); song.IsLooped = true; song.Play(); // TODO: use this.Content to load your game content here }