2 ms·
I hear their new technologically advanced nuclear missiles are powered by jQuery too. Can't wait for the inevitable Github repo. function launchRocket(rocketid
by DigitalSea 14y ago
I hear their new technologically advanced nuclear missiles are powered by jQuery too. Can't wait for the inevitable Github repo.
function launchRocket(rocketid, amountToFire = 1) {
var theRocket = getRocket(rocketid);
var currentlyLaunching = false;
var rocketsCount = 0;
if (rocketStatus == fuelled) {
if (currentlyLaunching == false && rocketsCount <= amountToFire) {
currentlyLaunching = true;
var firedRocket = theRocket.fire();
if (firedRocket.status == 'success') {
alert('Rocket has been a success glorious leader');
}
if (firedRocket.status == 'explodedonlaunch') {
alert('Wait, my glorious leader I can explain.');
}
if (firedRocket.status == 'didntevenlaunch') {
alert('Glorious leader, wai.... Ahhhhh!');
}
rocketsCount++;
currentlyLaunching = false;
}
}
}