From 62acf685daf29092e02aa7133db23c25476e6238 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 7 Feb 2014 08:44:54 -0800 Subject: [PATCH 1/2] Update script.js --- script.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index 22b5038..235597b 100644 --- a/script.js +++ b/script.js @@ -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; @@ -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); @@ -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(); + scene.hideCursor(); currentTime = new Timer(); currentTime.reset(); From f5500afa8c38cfe000e52f02e91a782086bd4503 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 7 Feb 2014 08:47:47 -0800 Subject: [PATCH 2/2] Add findCountry() to init(); --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index 235597b..258135c 100644 --- a/script.js +++ b/script.js @@ -99,7 +99,7 @@ function init() { scene = new Scene(); - + findCountry(); scene.hideCursor(); currentTime = new Timer(); currentTime.reset();