//------------------------------------------------------------- //Returns a WorldOptions object that defines the options for // the level. //------------------------------------------------------------- public static Buffers.WorldOptions Opt_6a() { Buffers.WorldOptions options = new Buffers.WorldOptions(); options.InitX = 2 * Buffers.W + 10; options.InitY = 9 * Buffers.H; options.SkyType = 3; options.WallType1 = 0; options.WallType2 = 0; options.WallType3 = 0; options.PipeColor = 0x30; options.GroundColor1 = 0x4B; options.GroundColor2 = 0; options.Horizon = 124; options.BackGrType = 10; options.BackGrColor1 = 0x36; options.BackGrColor2 = 0x30; options.Stars = 0; options.Clouds = 0; options.Design = 2; options.C2r = 10; options.C2g = 23; options.C2b = 8; options.C3r = 22; options.C3g = 35; options.C3b = 20; options.BrickColor = 0xB0; options.WoodColor = 0x48; options.XBlockColor = 0xA0; return options; }
//------------------------------------------------------------------- // Sets up and reads in a new world to the buffer. After the world // has been read, it will build and then finally start running the // world. // N1: char, the first part (before the hyphen) of the world name. // N2: char, the second part (before the hyphen) of the world name. // Map1: char[,], the map to play // Opt1: WorldOptions, options for the aboveground world of Map1 // Opt1b, WorldOptions, options for the underground world of Map1 // Map2, char[,] the underground of the map to play // Opt2, WorldOptions, options for the abovegound world of Map2 // Opt2b, WorldOptions, options for the underground world of Map2 // Player, byte, the player to put in the world. //------------------------------------------------------------------- public static bool PlayWorld(char N1, char N2, char[,] Map1, Buffers.WorldOptions Opt1, Buffers.WorldOptions Opt1b, char[,] Map2, Buffers.WorldOptions Opt2, Buffers.WorldOptions Opt2b, byte Player) { int j, k, x, y; int[] TotalBackGrAddr = new int[FormMarioPort.MAX_PAGE]; //PlayWorld = false; //Keyboard.Key = 0; //Palettes.ClearPalette(); //Palettes.LockPal(); Buffers.TextCounter = 0; Buffers.WorldNumber = new string[] { N1.ToString(), "-", N2.ToString() }; OnlyDraw = ((N1 == '0') && (N2 == '0')); ShowObjects = true; Players.InPipe = false; Players.PipeCode = new char[] { ' ', ' ' }; Buffers.Demo = Buffers.dmNoDemo; Buffers.InitLevelScore(); //FillChar (TotalBackGrAddr, TotalBackGrAddr.Size(), 0); for (int i = 0; i < TotalBackGrAddr.Length; i++) { TotalBackGrAddr[i] = 0; } ShowScore = false; if (!Enemies.Turbo) { Buffers.ReadWorld(Map2, ref Buffers.WorldMap, Opt2); Buffers.Swap(); Buffers.ReadWorld(Map1, ref Buffers.WorldMap, Opt1); } else { Buffers.ReadWorld(Map2, ref Buffers.WorldMap, Opt2b); Buffers.Swap(); Buffers.ReadWorld(Map1, ref Buffers.WorldMap, Opt1b); } //Console.WriteLine("Done Reading World"); Players.InitPlayer(Buffers.Options.InitX, Buffers.Options.InitY, Buffers.Player); Players.MapX = Buffers.Options.InitX; Players.MapY = Buffers.Options.InitY; Buffers.XView = 0; Buffers.YView = 0; //FillChar (LastXView, LastXView.Size(), 0); for (int i = 0; i < Buffers.LastXView.Length; i++) { Buffers.LastXView[i] = 0; } FormMarioPort.formRef.SetView(Buffers.XView, Buffers.YView); BuildLevel(); try { if (Restart()) { return(true); } } catch (Exception e) { Console.WriteLine("Exception: ", e); } Enemies.ClearEnemies(); //ClearGlitter(); //Palettes.FadeDown(64); //Palettes.ClearPalette(); //Music.StopMusic(); return(false); //http://en.wikipedia.org/wiki/Return_statement#Syntax //"In Pascal there is no return statement." ...wat!? }
//------------------------------------------------------------- //Returns a WorldOptions object that defines the options for // the level. //------------------------------------------------------------- public static Buffers.WorldOptions Opt_4a() { Buffers.WorldOptions options = new Buffers.WorldOptions(); options.InitX = 2 * Buffers.W + 10; options.InitY = 7 * Buffers.H; options.SkyType = 7; options.WallType1 = 102; options.WallType2 = 102; options.WallType3 = 0; options.PipeColor = 0x30; options.GroundColor1 = 0x49; options.GroundColor2 = 0; options.Horizon = 12; options.BackGrType = 6; options.BackGrColor1 = 0x34; options.BackGrColor2 = 0x4C; options.Stars = 0; options.Clouds = 0; options.Design = 5; options.C2r = 10; options.C2g = 23; options.C2b = 8; options.C3r = 22; options.C3g = 35; options.C3b = 20; options.BrickColor = 0x18; options.WoodColor = 0x18; options.XBlockColor = 0x68; return options; }