Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
//variables
var scene;
var plane;
var country;
var America;
var Germany;
var Britan;
var defaultCountry = "Images/RetroPlane.png";
var background;
var batteries;
var gasCans;
Expand All @@ -19,7 +24,7 @@
} //end counter()

function Plane() {
tPlane = new Sprite(scene, "Images/RetroPlane.png", 50, 50);
tPlane = new Sprite(scene, country, 50, 50);
tPlane.setSpeed(0);
tPlane.setPosition();
tPlane.setBoundAction(CONTINUE);
Expand Down Expand Up @@ -75,8 +80,26 @@
return tBackground;
} //end Background()

function findCountry() {
var whatCountry = prompt("What country do you want to play as? America, Germany, or Britan? If you don't write anything, your plane will be the default plane.").toUpperCase;
switch(whatCountry) {
case 'AMERICA':
country = America;
break;
case 'GERMANY':
country = Germany;
break;
case 'Britan':
country = Britan;
break
default:
country = defaultCountry;
}
}

function init() {
scene = new Scene();
findCountry();
scene.hideCursor();
currentTime = new Timer();
currentTime.reset();
Expand Down