public func Intro_Init(int difficulty) { // Set wind to the left, so that less lava is on the starting place. SetWind(-50 - Random(50)); // Determine crater lava height. var lava_y = 0; while (!GBackLiquid(LandscapeWidth() / 2, lava_y) && lava_y < LandscapeHeight()) lava_y++; // Create an airplane with pilot and fly it towards the peak. this.airplane = CreateObjectAbove(Airplane, LandscapeWidth() / 2 - 564, lava_y - 176); this.pilot = CreateObjectAbove(Clonk, LandscapeWidth() / 2 - 564, lava_y - 176); this.pilot->SetName("$PilotName$"); this.pilot->SetSkin(2); this.pilot->Enter(this.airplane); this.pilot->SetAction("Walk"); this.pilot->SetDir(DIR_Right); this.pilot->SetColor(0xff0000aa); this.airplane->PlaneMount(this.pilot); this.airplane->FaceRight(); this.airplane->StartInstantFlight(90, 15); this.airplane->SetXDir(12); this.airplane->SetYDir(-1); this.airplane->MakeInvincible(); this.airplane.intro_seq = this; // Fill the airplane with some materials. this.difficulty = difficulty; if (difficulty <= 2) { this.airplane->CreateContents(Loam, 5); this.airplane->CreateContents(Bread, 5); this.airplane->CreateContents(Wood, 8); this.airplane->CreateContents(Rock, 4); this.airplane->CreateContents(Metal, 4); if (difficulty <= 1) { this.airplane->CreateContents(Pickaxe, 2); for (var i = 0; i < 5; i++) this.airplane->CreateContents(Barrel)->PutLiquid("Water", 300); } } return; }
func Intro_Start() { // Intro starts high up in the clouds Music("TheSkylands"); LoadScenarioSection("Intro"); SetWind(-100); this.intro_skyscroll_xdir = -10; SetSkyParallax(0, 20, 20, this.intro_skyscroll_xdir, 0); this.plane = CreateObjectAbove(Airplane, 500, 200); this.plane->SetColor(0xa04000); this.pilot = CreateObjectAbove(Clonk, 100, 100, NO_OWNER); this.pilot->MakeInvincible(); this.pilot->SetSkin(2); this.pilot->Enter(this.plane); this.pilot->SetAction("Walk"); this.pilot->SetName("Pyrit"); this.pilot->SetColor(0xff0000); this.pilot->SetAlternativeSkin("MaleBrownHair"); this.pilot->SetDir(DIR_Left); this.pilot->SetObjectLayer(this.pilot); this.pilot->AttachMesh(Hat, "skeleton_head", "main", Trans_Translate(5500, 0, 0)); // Hat is seen in the cockpit! this.plane->PlaneMount(this.pilot); this.plane.FxIntPlaneTimer = this.Intro_PlaneTimer; RemoveEffect("IntPlane", this.plane); AddEffect("IntPlane",this.plane,1,1,this.plane); this.plane->FaceRight(); this.plane->StartInstantFlight(90, 0); g_intro_sky_moving = true; SetViewTarget(this.plane); return ScheduleNext(100, 1); }