Advertisement
Guest User

Untitled

a guest
Dec 11th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package
  2. {
  3.  
  4.     import flash.display.MovieClip;
  5.     import flash.events.Event;
  6.     import flash.ui.Keyboard;
  7.     import flash.net.SharedObject;
  8.  
  9.  
  10.     public class Ship extends MovieClip
  11.     {
  12.         var firstpart:Boolean = false;
  13.         var nreleased:Boolean = false;
  14.         var storystarted:Boolean = false;
  15.         var storyended:Boolean = false;
  16.         var preleased:Boolean = false;
  17.  
  18.         var mreleased:Boolean = false;
  19.         var roundtimer:Number;
  20.         var timeplayed:Number;
  21.         var randomBallTimer:Number;
  22.         var xVelocity:Number;
  23.         var yVelocity:Number;
  24.         var shootTimer:Number;
  25.         var shootTimerVar:Number;
  26.         var thrust:Number;
  27.         var thrustVar:Number;
  28.         var brakesVar:Number;
  29.         var topSpeedVar:Number;
  30.         var ShieldPower:Number;
  31.         var turnSpeedVar:Number;
  32.         var numberOfBulletsVar:Number;
  33.         var invuln:Boolean = false;
  34.         var invulnUsed:Boolean = false;
  35.         var invulnTimer:Number;
  36.         var isduck:Boolean = false;
  37.         var Round:Number;
  38.         var timesteleported:Number;
  39.         var skipstory:Boolean = false;
  40.         var savedData:SharedObject;
  41.  
  42.         function Ship()
  43.         {
  44.             Round = 0;
  45.             invulnTimer = 0;
  46.             randomBallTimer = 0;
  47.             thrust = 0;
  48.             yVelocity = 0;
  49.             xVelocity = 5;
  50.             shootTimer = 0;
  51.             roundtimer = 1800;
  52.  
  53.  
  54.             savedData = SharedObject.getLocal("newtest7");
  55.             if (savedData.data.timesteleported == undefined)
  56.             {
  57.                 trace('bananananananna');
  58.                 timesteleported = 0;
  59.                 timeplayed = 0;
  60.  
  61.                 numberOfBulletsVar = 1;
  62.                 turnSpeedVar = 1;
  63.                 ShieldPower = 1;
  64.  
  65.                 shootTimerVar = 1;
  66.                 topSpeedVar = 1;
  67.                 brakesVar = 1;
  68.                 thrustVar = 1;
  69.  
  70.  
  71.             }
  72.             else
  73.             {
  74.                 timesteleported = savedData.data.timesteleported;
  75.                 timeplayed = savedData.data.timesplayed;
  76.                 numberOfBulletsVar = savedData.data.numberOfBulletsVar;
  77.                 turnSpeedVar = savedData.data.turnSpeedVar;
  78.                 ShieldPower = savedData.data.ShieldPower;
  79.  
  80.                 shootTimerVar = savedData.data.shootTimerVar;
  81.                 topSpeedVar = savedData.data.topSpeedVar;
  82.                 brakesVar = savedData.data.brakesVar;
  83.                 thrustVar = savedData.data.thrustVar;
  84.  
  85.  
  86.                
  87.                
  88.             }
  89.  
  90.             this.x = 300;
  91.             this.y = 200;
  92.             addEventListener("enterFrame", move);
  93.  
  94.         }
  95.         function saveg(e:Event)
  96.         {
  97.             savedData.data.timesteleported = timesteleported;
  98.             savedData.data.timeplayed = timeplayed;
  99.  
  100.  
  101.             savedData.data.numberOfBulletsVar = numberOfBulletsVar;
  102.             savedData.data.turnSpeedVar = turnSpeedVar;
  103.             ShieldPower = savedData.data.ShieldPower;
  104.  
  105.             savedData.data.shootTimerVar = shootTimerVar;
  106.             savedData.data.topSpeedVar = topSpeedVar;
  107.             savedData.data.brakesVar = brakesVar;
  108.             savedData.data.thrustVar = thrustVar;
  109.  
  110.         }
  111.         function changemode()
  112.         {
  113.             if (isduck == false)
  114.             {
  115.                 gotoAndPlay(1);
  116.                 shipinvuln.visible = false;
  117.             }
  118.             if (isduck == true)
  119.             {
  120.                 if (Game.duckyach == false && shootTimerVar == 1)
  121.                 {
  122.                     Game.updateach("Achievement Unlocked: DUCKY!");
  123.                     Game.updateScore(3000);
  124.                     Game.duckyach = true;
  125.                     Game.achMenu.duck.gotoAndStop(2);
  126.                 }
  127.                 gotoAndPlay(6);
  128.                 duckinvuln.visible = false;
  129.             }
  130.         }
  131.  
  132.         function die()
  133.         {
  134.             Game.timesdied +=  1;
  135.             firstpart = false;
  136.             this.visible = false;
  137.             Game.gameOver();
  138.             roundtimer = 1800;
  139.             storystarted = false;
  140.             storyended = false;
  141.             Game.soundbutton.togglestyle();
  142.         }
  143.         function thestory()
  144.         {
  145.             if (storyended == true)
  146.             {
  147.                 if (skipstory == false)
  148.                 {
  149.                     thrust = 0;
  150.                     if (Round == 1 && firstpart == false)
  151.                     {
  152.                         Game.Story.visible = false;
  153.                         roundtimer = 0;
  154.  
  155.                         firstpart = true;
  156.  
  157.                     }
  158.                     else
  159.                     {
  160.                         Game.Story.visible = false;
  161.                         Round +=  1;
  162.                         roundtimer = 0;
  163.                         Game.soundbutton.togglestyle();
  164.  
  165.                     }
  166.                 }
  167.                 else
  168.                 {
  169.                     if (Round == 1 && firstpart == false)
  170.                     {
  171.                         roundtimer = 0;
  172.  
  173.                         firstpart = true;
  174.                     }
  175.                     else
  176.                     {
  177.  
  178.                         Game.Story.visible = false;
  179.                         Round +=  1;
  180.                         roundtimer = 0;
  181.                         Game.soundbutton.togglestyle();
  182.  
  183.                     }
  184.                 }
  185.             }
  186.             if (storystarted == false)
  187.             {
  188.                 if (skipstory == false)
  189.                 {
  190.                     Game.Story.visible = true;
  191.                     if (firstpart == false)
  192.                     {
  193.                         Game.Story.gotoAndStop(1);
  194.                     }
  195.                     else
  196.                     {
  197.  
  198.                         Game.Story.gotoAndStop(Round*10+1);
  199.                     }
  200.                     storystarted = true;
  201.                     if (firstpart == true)
  202.                     {
  203.                         Game.soundbutton.togglestyle();
  204.                     }
  205.                 }
  206.                 else
  207.                 {
  208.                     storystarted = true;
  209.  
  210.                     roundtimer = 0;
  211.                 }
  212.             }
  213.         }
  214.         function move(e:Event)
  215.         {
  216.  
  217.             trace(ShieldPower);
  218.             if (roundtimer == 30)
  219.             {
  220.                 storystarted = false;
  221.                 storyended = false;
  222.                 Game.soundbutton.togglestyle();
  223.                 trace("banana");
  224.  
  225.             }
  226.             if (Key.isDown(78))
  227.             {
  228.  
  229.                 if (nreleased)
  230.                 {
  231.  
  232.  
  233.                     if (Game.Story.visible == true)
  234.                     {
  235.                         Game.Story.nextFrame();
  236.                     }
  237.                 }
  238.                 nreleased = false;
  239.             }
  240.             else
  241.             {
  242.                 nreleased = true;
  243.  
  244.             }
  245.             if (Game.gameOverMenu.visible == true)
  246.             {
  247.                 Game.gameOver();
  248.             }
  249.             if (Key.isDown(80))
  250.             {
  251.                 if (preleased)
  252.                 {
  253.  
  254.                     Game.Paused = ! Game.Paused;
  255.                 }
  256.                 preleased = false;
  257.             }
  258.             else
  259.             {
  260.                 preleased = true;
  261.  
  262.             }
  263.             if (Game.Paused == false)
  264.             {
  265.                 if (Game.mainMenu.visible == false)
  266.                 {
  267.                     roundtimer +=  1;
  268.                 }
  269.                 if (roundtimer >= 1800 && this.visible == true)
  270.                 {
  271.  
  272.                     Game.enemyShipTimer.stop();
  273.                     Game.enemyShip2Timer.stop();
  274.                     Game.enemyShip3Timer.stop();
  275.                     Game.enemyShip4Timer.stop();
  276.                     Game.enemyShip5Timer.stop();
  277.  
  278.                     if (Game.list.length == 0)
  279.                     {
  280.  
  281.                         thestory();
  282.                         this.x = 200;
  283.                         this.y = 300;
  284.                         rotation = 0;
  285.                     }
  286.  
  287.  
  288.                 }
  289.  
  290.                 if (Game.enemieskilled == 1)
  291.                 {
  292.                     if (Game.asteroidkillerach == false)
  293.                     {
  294.                         Game.updateach("Achievement Unlocked: Asteroid Killer");
  295.                         Game.updateScore(500);
  296.                         Game.asteroidkillerach = true;
  297.                         Game.achMenu.akil.gotoAndStop(2);
  298.                     }
  299.                 }
  300.                 if (timesteleported == 1)
  301.                 {
  302.                     if (Game.teleported1time == false)
  303.                     {
  304.                         Game.updateach("Achievement Unlocked: OH HAI THERE!");
  305.                         Game.updateScore(500);
  306.                         Game.teleported1time = true;
  307.                         Game.achMenu.ohha.gotoAndStop(2);
  308.                     }
  309.                 }
  310.                 if (timesteleported == 100)
  311.                 {
  312.                     if (Game.teleported1time == false)
  313.                     {
  314.                         Game.updateach("Achievement Unlocked: One small step for asteroid hunters");
  315.                         Game.updateScore(3000);
  316.                         Game.teleported100time = true;
  317.                         Game.achMenu.Step.gotoAndStop(2);
  318.                     }
  319.                 }
  320.                 if (timesteleported == 1000)
  321.                 {
  322.                     if (Game.teleported1000time == false)
  323.                     {
  324.                         Game.updateach("Achievement Unlocked: One giant leap for asteroid hunters kind");
  325.                         Game.updateScore(5000);
  326.                         Game.teleported1000time = true;
  327.                         Game.achMenu.leap.gotoAndStop(2);
  328.                     }
  329.                 }
  330.                 if (Game.enemieskilled == 100)
  331.                 {
  332.                     if (Game.asteroidkiller2ach == false)
  333.                     {
  334.                         Game.updateach("Achievement Unlocked: Asteroid Hunter");
  335.                         Game.updateScore(1200);
  336.                         Game.asteroidkiller2ach = true;
  337.                         Game.achMenu.ahun.gotoAndStop(2);
  338.                     }
  339.                 }
  340.                 if (Game.enemieskilled == 1337)
  341.                 {
  342.                     if (Game.asteroidkiller3ach == false)
  343.                     {
  344.                         Game.updateach("Achievement Unlocked: 1337 asteroid Killer");
  345.                         Game.updateScore(1337);
  346.                         Game.asteroidkillerach = true;
  347.                         Game.achMenu.leet.gotoAndStop(2);
  348.                     }
  349.                 }
  350.                 if (Game.enemieskilled == 9001)
  351.                 {
  352.                     if (Game.asteroidkiller4ach == false)
  353.                     {
  354.                         Game.updateach("Achievement Unlocked: ITS OVER 9000!");
  355.                         Game.updateScore(9001);
  356.                         Game.asteroidkillerach = true;
  357.                         Game.achMenu.over.gotoAndStop(2);
  358.                     }
  359.                 }
  360.                 if (timeplayed == 1800)
  361.                 {
  362.                     if (Game.a1minuteplayed == false)
  363.                     {
  364.                         Game.updateach("Achievement Unlocked: Wading the waters");
  365.                         Game.updateScore(1000);
  366.                         Game.a1minuteplayed = true;
  367.                         Game.achMenu.wadi.gotoAndStop(2);
  368.                     }
  369.                 }
  370.                 if (timeplayed == 9000)
  371.                 {
  372.                     if (Game.a5minuteplayed == false)
  373.                     {
  374.                         Game.updateach("Achievement Unlocked: Being a player");
  375.                         Game.updateScore(3000);
  376.                         Game.a5minuteplayed = true;
  377.                         Game.achMenu.bein.gotoAndStop(2);
  378.                     }
  379.                 }
  380.                 if (timeplayed == 27000)
  381.                 {
  382.                     if (Game.a15minuteplayed == false)
  383.                     {
  384.                         Game.updateach("Achievement Unlocked: Gamer");
  385.                         Game.updateScore(5000);
  386.                         Game.a15minuteplayed = true;
  387.                         Game.achMenu.game.gotoAndStop(2);
  388.                     }
  389.                 }
  390.                 if (timeplayed == 54000)
  391.                 {
  392.                     if (Game.a30minuteplayed == false)
  393.                     {
  394.                         Game.updateach("Achievement Unlocked: Must not...");
  395.                         Game.updateScore(1000);
  396.                         Game.a30minuteplayed = true;
  397.                         Game.achMenu.must.gotoAndStop(2);
  398.                     }
  399.                 }
  400.                 if (timeplayed == 108000)
  401.                 {
  402.                     if (Game.a60minuteplayed == false)
  403.                     {
  404.                         Game.updateach("Achievement Unlocked: GO OUTSIDE!");
  405.                         Game.updateScore(15000);
  406.                         Game.a60minuteplayed = true;
  407.                         Game.achMenu.goou.gotoAndStop(2);
  408.                     }
  409.                 }
  410.  
  411.                 Game.achtimer +=  1;
  412.                 if (Game.achtimer > 150)
  413.                 {
  414.                     Game.updateach('');
  415.                 }
  416.                 if (Round == 1)
  417.                 {
  418.                     Game.enemyShipTimer.start();
  419.                     Game.enemyShip5Timer.stop();
  420.                     Game.enemyShip4Timer.stop();
  421.                     Game.enemyShip3Timer.stop();
  422.                     Game.enemyShip2Timer.stop();
  423.  
  424.                 }
  425.  
  426.                 if (Round == 2)
  427.                 {
  428.                     Game.enemyShipTimer.stop();
  429.                     Game.enemyShip2Timer.start();
  430.                 }
  431.                 if (Round == 3)
  432.                 {
  433.                     Game.enemyShipTimer.start();
  434.                     Game.enemyShip2Timer.start();
  435.                 }
  436.  
  437.                 if (Round == 5)
  438.                 {
  439.                     Game.enemyShip2Timer.stop();
  440.                     Game.enemyShipTimer.start();
  441.                     Game.enemyShip3Timer.start();
  442.                 }
  443.                 if (Round == 6)
  444.                 {
  445.                     Game.enemyShipTimer.start();
  446.                     Game.enemyShip2Timer.start();
  447.                     Game.enemyShip3Timer.start();
  448.                 }
  449.                 if (Round == 7)
  450.                 {
  451.                     Game.enemyShip3Timer.stop();
  452.                     Game.enemyShip2Timer.start();
  453.                     Game.enemyShip4Timer.start();
  454.                     Game.enemyShipTimer.start();
  455.                 }
  456.                 if (Round == 8)
  457.                 {
  458.                     Game.enemyShipTimer.stop();
  459.                     Game.enemyShip2Timer.start();
  460.                     Game.enemyShip4Timer.start();
  461.                     Game.enemyShip3Timer.start();
  462.                 }
  463.                 if (Round == 10)
  464.                 {
  465.                     Game.enemyShip4Timer.stop();
  466.                     Game.enemyShip3Timer.start();
  467.                     Game.enemyShip2Timer.start();
  468.                     Game.enemyShip5Timer.start();
  469.                 }
  470.  
  471.  
  472.  
  473.  
  474.  
  475.                 if (ShieldPower > 5 && Game.shrunk == false)
  476.                 {
  477.                     width = width * .7;
  478.                     height = height * .7;
  479.                     Game.shrunk = true;
  480.                 }
  481.                 if (ShieldPower > 2 && Game.grown == false)
  482.                 {
  483.                     width = width * 1.2;
  484.                     height = height * 1.2;
  485.                     Game.grown = true;
  486.                 }
  487.                 if (this.visible == true)
  488.                 {
  489.  
  490.                     if (Game.Paused == false && Game.Story.visible == false)
  491.                     {
  492.                         timeplayed +=  1;
  493.                         if (invulnUsed == true)
  494.                         {
  495.                             invulnTimer +=  1;
  496.                             if (isduck == false)
  497.                             {
  498.                                 shipinvuln.visible = true;
  499.                             }
  500.                             if (isduck == true)
  501.                             {
  502.                                 duckinvuln.visible = true;
  503.                                 if (Game.nduckyach == false)
  504.                                 {
  505.                                     Game.updateach("Achievement Unlocked: Ninja Duck");
  506.                                     Game.updateScore(1000);
  507.                                     Game.nduckyach = true;
  508.                                     Game.achMenu.ninj.gotoAndStop(2);
  509.                                 }
  510.                             }
  511.                         }
  512.                         if (invulnTimer >= 90)
  513.                         {
  514.                             if (isduck == false)
  515.                             {
  516.                                 shipinvuln.visible = false;
  517.                             }
  518.                             if (isduck == true)
  519.                             {
  520.                                 duckinvuln.visible = false;
  521.                             }
  522.                             invuln = false;
  523.  
  524.                         }
  525.                         this.y = this.y + yVelocity;
  526.                         this.x = this.x + xVelocity;
  527.                         xVelocity = Math.cos(rotation * Math.PI / 180) * thrust;
  528.                         yVelocity = Math.sin(rotation * Math.PI / 180) * thrust;
  529.  
  530.                         if (this.x >= 600)
  531.                         {
  532.                             timesteleported +=  1;
  533.                             this.x = 1;
  534.                         }
  535.                         if (this.x <= 0)
  536.                         {
  537.                             timesteleported +=  1;
  538.                             this.x = 599;
  539.                         }
  540.                         if (this.y <= 0)
  541.                         {
  542.                             timesteleported +=  1;
  543.                             this.y = 599;
  544.                         }
  545.                         if (this.y >= 600)
  546.                         {
  547.                             timesteleported +=  1;
  548.                             this.y = 1;
  549.                         }
  550.  
  551.                         if (ShieldPower > 9)
  552.                         {
  553.                             randomBallTimer +=  1;
  554.                         }
  555.                         shootTimer +=  1;
  556.                         if (Key.isDown(Keyboard.SPACE) && randomBallTimer >= 40)
  557.                         {
  558.  
  559.                             var randomball = new RandomBall();
  560.                             stage.addChild(randomball);
  561.                             randomball.rotation = this.rotation;
  562.                             randomball.x = this.x;
  563.                             randomball.y = this.y;
  564.                             randomBallTimer = 0;
  565.  
  566.                         }
  567.  
  568.                         if (Key.isDown(Keyboard.SPACE) && shootTimer >= 20 - shootTimerVar * 1)
  569.                         {
  570.  
  571.  
  572.                             var bullets = new Bullet();
  573.                             stage.addChild(bullets);
  574.                             bullets.rotation = this.rotation;
  575.                             bullets.x = this.x;
  576.                             bullets.y = this.y;
  577.                             shootTimer = 0;
  578.                             if (numberOfBulletsVar > 1)
  579.                             {
  580.                                 var bullets1 = new Bullet1();
  581.                                 stage.addChild(bullets1);
  582.                                 bullets1.rotation = this.rotation;
  583.                                 bullets1.x = this.x;
  584.                                 bullets1.y = this.y;
  585.                                 shootTimer = 0;
  586.                             }
  587.                             if (numberOfBulletsVar > 2)
  588.                             {
  589.                                 var bullets2 = new Bullet2();
  590.                                 stage.addChild(bullets2);
  591.                                 bullets2.rotation = this.rotation;
  592.                                 bullets2.x = this.x;
  593.                                 bullets2.y = this.y;
  594.                                 shootTimer = 0;
  595.                             }
  596.                             if (numberOfBulletsVar > 3)
  597.                             {
  598.                                 var bullets3 = new Bullet3();
  599.                                 stage.addChild(bullets3);
  600.                                 bullets3.rotation = this.rotation;
  601.                                 bullets3.x = this.x;
  602.                                 bullets3.y = this.y;
  603.                                 shootTimer = 0;
  604.                             }
  605.                             if (numberOfBulletsVar > 4)
  606.                             {
  607.                                 var bullets4 = new Bullet4();
  608.                                 stage.addChild(bullets4);
  609.                                 bullets4.rotation = this.rotation;
  610.                                 bullets4.x = this.x;
  611.                                 bullets4.y = this.y;
  612.                                 shootTimer = 0;
  613.                             }
  614.                             if (numberOfBulletsVar > 5)
  615.                             {
  616.                                 var bullets5 = new Bullet5();
  617.                                 stage.addChild(bullets5);
  618.                                 bullets5.rotation = this.rotation;
  619.                                 bullets5.x = this.x;
  620.                                 bullets5.y = this.y;
  621.                                 shootTimer = 0;
  622.                             }
  623.                             if (numberOfBulletsVar > 6)
  624.                             {
  625.                                 var bullets6 = new Bullet6();
  626.                                 stage.addChild(bullets6);
  627.                                 bullets6.rotation = this.rotation;
  628.                                 bullets6.x = this.x;
  629.                                 bullets6.y = this.y;
  630.                                 shootTimer = 0;
  631.                             }
  632.                             if (numberOfBulletsVar > 7)
  633.                             {
  634.                                 var bullets7 = new Bullet7();
  635.                                 stage.addChild(bullets7);
  636.                                 bullets7.rotation = this.rotation;
  637.                                 bullets7.x = this.x;
  638.                                 bullets7.y = this.y;
  639.                                 shootTimer = 0;
  640.                             }
  641.                             if (numberOfBulletsVar > 8)
  642.                             {
  643.                                 var bullets8 = new Bullet8();
  644.                                 stage.addChild(bullets8);
  645.                                 bullets8.rotation = this.rotation;
  646.                                 bullets8.x = this.x;
  647.                                 bullets8.y = this.y;
  648.                                 shootTimer = 0;
  649.                             }
  650.                             if (numberOfBulletsVar > 9)
  651.                             {
  652.                                 var bullets9 = new Bullet9();
  653.                                 stage.addChild(bullets9);
  654.                                 bullets9.rotation = this.rotation;
  655.                                 bullets9.x = this.x;
  656.                                 bullets9.y = this.y;
  657.                                 shootTimer = 0;
  658.                             }
  659.                             if (numberOfBulletsVar > 9)
  660.                             {
  661.  
  662.                                 bullets1.width = bullets1.width * 1.3;
  663.                                 bullets1.height = bullets1.height * 1.3;
  664.                                 bullets2.width = bullets2.width * 1.3;
  665.                                 bullets2.height = bullets2.height * 1.3;
  666.                                 bullets3.width = bullets3.width * 1.3;
  667.                                 bullets3.height = bullets3.height * 1.3;
  668.                                 bullets4.width = bullets4.width * 1.3;
  669.                                 bullets4.height = bullets4.height * 1.3;
  670.                                 bullets5.width = bullets5.width * 1.3;
  671.                                 bullets5.height = bullets5.height * 1.3;
  672.                                 bullets6.width = bullets6.width * 1.3;
  673.                                 bullets6.height = bullets6.height * 1.3;
  674.                                 bullets7.width = bullets7.width * 1.3;
  675.                                 bullets7.height = bullets7.height * 1.3;
  676.                                 bullets8.width = bullets8.width * 1.3;
  677.                                 bullets8.height = bullets8.height * 1.3;
  678.                                 bullets9.width = bullets9.width * 1.3;
  679.                                 bullets9.height = bullets9.height * 1.3;
  680.                             }
  681.                         }
  682.                         if (Key.isDown(Keyboard.RIGHT))
  683.                         {
  684.                             this.rotation +=  turnSpeedVar * 0.5 + 1.5;
  685.                         }
  686.  
  687.                         if (Key.isDown(Keyboard.LEFT))
  688.                         {
  689.                             this.rotation -=  turnSpeedVar * 0.5 + 1.5;
  690.                         }
  691.  
  692.                         if (Key.isDown(68))
  693.                         {
  694.                             this.rotation +=  turnSpeedVar * 0.5 + 1.5;
  695.                         }
  696.  
  697.                         if (Key.isDown(65))
  698.                         {
  699.                             this.rotation -=  turnSpeedVar * 0.5 + 1.5;
  700.                         }
  701.                         if (Key.isDown(191) && invulnUsed == false && ShieldPower > 10)
  702.                         {
  703.  
  704.                             invuln = true;
  705.                             invulnUsed = true;
  706.                         }
  707.                         if (Key.isDown(81) && invulnUsed == false && ShieldPower > 10)
  708.                         {
  709.  
  710.                             invuln = true;
  711.                             invulnUsed = true;
  712.                         }
  713.                         if (Key.isDown(87))
  714.                         {
  715.                             if (thrust <= topSpeedVar * 1.5 + 1)
  716.                             {
  717.                                 thrust +=  thrustVar / 50 + .1;
  718.  
  719.                             }
  720.                         }
  721.                         if (Key.isDown(Keyboard.UP))
  722.                         {
  723.  
  724.                             if (thrust <= topSpeedVar * 1.5 + 1)
  725.                             {
  726.                                 thrust +=  thrustVar / 50 + .1;
  727.  
  728.                             }
  729.                         }
  730.                         if (Key.isDown(83))
  731.                         {
  732.                             if (thrust >= 0)
  733.                             {
  734.                                 thrust -=  brakesVar / 40 + .1;
  735.                             }
  736.                             if (thrust <= 0)
  737.                             {
  738.                                 thrust = 0;
  739.                             }
  740.                         }
  741.  
  742.                         if (Key.isDown(Keyboard.DOWN))
  743.                         {
  744.                             if (thrust >= 0)
  745.                             {
  746.                                 thrust -=  brakesVar / 40 + .1;
  747.                             }
  748.                             if (thrust <= 0)
  749.                             {
  750.                                 thrust = 0;
  751.                             }
  752.                         }
  753.  
  754.                     }
  755.                 }
  756.             }
  757.         }
  758.     }
  759. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement