public void ChangeScene(string mapName, Direction enterDirection, float position) { GameMap newScene = new GameMap(mapName + ".txt", enterDirection, position); this.ChangeScene(newScene); }
public void StartEditor(GameMap map) { if (!this.fullScreen && this.UsingExternalMaps) { this.editor = new frmLevelEditor(map); this.editor.Show(); this.editor.Location = new Point(this.gameWindow.Location.X + this.gameWindow.Size.Width, this.gameWindow.Location.Y); } }
public void ChangeScene(string mapName, int doorID) { if (mapName.Equals("NONE")) { this.Quit("That's all for now!"); } else if (mapName.IndexOf("*") == 0) { if (mapName.Equals("*INTRO")) { this.game.GotoSpecialScene(SpecialScenes.AfterCastle); } if (mapName.Equals("*TRANSFORMROOM") || mapName.Equals("*FOXTRANSFORM")) { GameMap newScene = new GameMap("transformroom.txt", 1); GameObject obj2 = new GameObject(new GameTexture("debug.bmp", new Size(0x10, 0x10), TextureDisposePolicy.DisposeOnTileChange), ObjectType.Transformer); obj2.DefineAnimation(AnimType.Stopped, new Animation(Point.Empty, Size.Empty)); obj2.GetAnimation(AnimType.Stopped).HitboxSize = new SizeF(16f, 16f); obj2.Location = new PointF(160f, 140f); TransformBlockBehavior behavior = new TransformBlockBehavior(obj2); if (mapName.Equals("*FOXTRANSFORM")) { behavior.SecretTransform(); } obj2.SetBehavior(behavior); obj2.Visible = false; newScene.AddObject(obj2); newScene.NextMap = "*" + this.game.CurrentMap.MapFilename; this.ChangeScene(newScene); } else if (mapName.Equals("*TOWNRETURN")) { GameMap map2 = new GameMap("townreturn.txt", 1) { NextMap = "*" + this.game.CurrentMap.MapFilename }; this.ChangeScene(map2); } else if (mapName.Equals("*RETURN")) { GameMap map3 = new GameMap(this.game.CurrentMap.NextMap.Substring(1), 100); this.ChangeScene(map3); } else if (mapName.Equals("*END")) { this.game.CurrentMap.HandleEndingDoor(); } } else { GameMap map4 = new GameMap(mapName + ".txt", doorID); this.ChangeScene(map4); } }