home *** CD-ROM | disk | FTP | other *** search
- if(kollision == 0)
- {
- if(Key.isDown(Key.UP) and key_aktiv == 1 or Key.isDown(Key.DOWN) and key_aktiv == 1)
- {
- key_aktiv = 1;
- }
- else
- {
- key_aktiv = 0;
- }
- if(key_aktiv == 0)
- {
- if(Key.isDown(Key.DOWN))
- {
- if(speed >= -15)
- {
- speed -= 25;
- }
- key_aktiv = 1;
- }
- if(Key.isDown(Key.UP))
- {
- if(speed < 75)
- {
- speed += 25;
- }
- key_aktiv = 1;
- }
- }
- }
- if(kollision == 0)
- {
- if(Key.isDown(Key.RIGHT))
- {
- winkel += 1.5;
- }
- if(Key.isDown(Key.LEFT))
- {
- winkel -= 1.5;
- }
- }
- showwinkel = winkel;
- if(schiffspeed < speed)
- {
- schiffspeed += 1;
- }
- else if(speed < schiffspeed)
- {
- schiffspeed -= 1;
- }
- else
- {
- schiffspeed = speed;
- }
- if(schiffwinkel < winkel)
- {
- schiffwinkel += (winkel - schiffwinkel) / 25;
- }
- else if(winkel < schiffwinkel)
- {
- schiffwinkel += (winkel - schiffwinkel) / 25;
- }
- showschiffwinkel = schiffwinkel;
- while(showschiffwinkel < 0)
- {
- showschiffwinkel += 360;
- }
- while(showschiffwinkel >= 360)
- {
- showschiffwinkel -= 360;
- }
- while(showwinkel < 0)
- {
- showwinkel += 360;
- }
- while(showwinkel >= 360)
- {
- showwinkel -= 360;
- }
- i = 1;
- while(55 >= i)
- {
- if(_root.schiff.vorne.hittest("_root.eisberg" add i))
- {
- kollision = 1;
- if(kollision != 0)
- {
- schadenspeed = schiffspeed / 2;
- schiffspeed = -20;
- speed = 0;
- }
- }
- else
- {
- kollision = 0;
- }
- if(_root.schiff.links.hittest("_root.eisberg" add i))
- {
- kollision = 2;
- if(kollision != 0)
- {
- schadenspeed = schiffspeed / 3;
- schiffspeed = -20;
- speed = 0;
- }
- }
- else
- {
- kollision = 0;
- }
- if(_root.schiff.rechts.hittest("_root.eisberg" add i))
- {
- kollision = 3;
- if(kollision != 0)
- {
- schadenspeed = schiffspeed / 3;
- schiffspeed = -20;
- speed = 0;
- }
- else
- {
- kollision = 0;
- }
- }
- if(_root.schiff.hintenlinks.hittest("_root.eisberg" add i))
- {
- kollision = 4;
- if(kollision != 0)
- {
- schadenspeed = schiffspeed / 4;
- winkel -= 2;
- schiffspeed = 10;
- }
- else
- {
- kollision = 0;
- }
- }
- if(_root.schiff.hintenrechts.hittest("_root.eisberg" add i))
- {
- kollision = 5;
- if(kollision != 0)
- {
- schadenspeed = schiffspeed / 4;
- winkel += 2;
- schiffspeed = 10;
- }
- else
- {
- kollision = 0;
- }
- }
- i++;
- }
- if(schadenspeed < 0)
- {
- schaden += schadenspeed - schadenspeed - schadenspeed;
- }
- else
- {
- schaden += schadenspeed;
- }
- if(schaden >= 100)
- {
- schaden = 100;
- gotoAndPlay(7016);
- }
- schadenspeed = 0;
- if(speed < 0)
- {
- diesel += speed * 2;
- }
- else
- {
- diesel -= speed * 2;
- }
- if(0 >= diesel)
- {
- gotoAndPlay(6996);
- }
- sin = Math.sin(0.017453292519943295 * schiffwinkel);
- cos = Math.cos(0.017453292519943295 * schiffwinkel);
- xschiff = xschiff + schiffspeed * sin / 20 + xstroemung;
- yschiff = yschiff + schiffspeed * (cos - cos - cos) / 20 + ystroemung;
- if(yschiff < -50 or 450 < yschiff or xschiff < 0 or 550 < xschiff)
- {
- gotoAndPlay(7006);
- }
- if(_root.schiff.vorne.hittest(_root.exit))
- {
- gotoAndStop(7027);
- }
- if(yschiff < 120 and background < 700)
- {
- background += background_schritt;
- yschiff += background_schritt;
- i = 1;
- while(55 >= i)
- {
- setProperty("_root.eisberg" add i, _Y, getProperty("_root.eisberg" add i, _Y) + background_schritt);
- i++;
- }
- setProperty(_root.exit, _Y, getProperty(_root.exit, _Y) + background_schritt);
- }
- if(300 < yschiff and -300 < background)
- {
- background -= background_schritt;
- yschiff -= background_schritt;
- i = 1;
- while(55 >= i)
- {
- setProperty("_root.eisberg" add i, _Y, getProperty("_root.eisberg" add i, _Y) - background_schritt);
- i++;
- }
- setProperty(_root.exit, _Y, getProperty(_root.exit, _Y) - background_schritt);
- }
- setProperty("_root.schiff", _rotation, showwinkel);
- setProperty("_root.schiff", _X, xschiff);
- setProperty("_root.schiff", _Y, yschiff);
- setProperty("_root.speed", _yscale, schiffspeed);
- setProperty("_root.speedregler", _Y, speed - speed - speed + 355);
- setProperty("_root.background", _Y, background);
- setProperty("_root.diesel", _yscale, diesel / 100000 * 100);
- setProperty("_root.schaden", _yscale, schaden);
-