Tuesday, January 31, 2017

CODE.ORG Homework Asssignment

Code Goes Here:)

In this game you start off as R2-D2 at normal speed on Endor, but be careful there are two Stormtroopers after you.  You must get the Mynock, which then produces a Puffer Pig.  Get the Puffer Pig and you are now on Hoth with a Tauntaun.  The bad guys are still after you.  Get the Tauntaun and you find yourself on a Starship and as C3-PO.  C3-PO is super slow, so use the Obstacles to give him super speed.  Get the Mouse Droid, but two more Stormtroopers follow it.  You must quickly kill the Probot to save the Rebel Pilot, who is also being chased by two more Stormtroopers.  You win the game by saving the Rebel Pilot and lose the game whenever a Stormtrooper kills you at any map level.

Have Fun!!!

setBackground("Endor");
setMap("blobs");
setDroid("R2-D2");
setDroidSpeed("normal");
playSound("R2-D2random");
function whenUp() {
  goUp();
}
function whenDown() {
  goDown();
}
function whenLeft() {
  goLeft();
}
function whenRight() {
  goRight();
}
moveSlow("PufferPig");
moveSlow("Probot");
moveNormal("Mynock");
moveNormal("Tauntaun");
moveNormal("RebelPilot");
moveFast("MouseDroid");
moveFast("Stormtrooper");
addCharacter("Mynock");
addCharacter("Stormtrooper");
addCharacter("Stormtrooper");
function whenTouchObstacle() {
  setDroidSpeed("fast");
}
function whenGetMynock() {
  setDroidSpeed("normal");
  addCharacter("PufferPig");
  playSound("MynockRandom");
  addPoints(1);
}
function whenGetPufferPig() {
  addCharacter("Tauntaun");
  playSound("PufferPigRandom");
  addPoints(5);
  setBackground("Hoth");
  setMap("circle");
  setDroidSpeed("normal");
}
function whenGetTauntaun() {
  addCharacter("MouseDroid");
  playSound("TauntaunRandom");
  addPoints(10);
  setDroidSpeed("normal");
}
function whenGetMouseDroid() {
  setDroid("C-3PO");
  setDroidSpeed("slow");
  setBackground("Starship");
  setMap("grid");
  addCharacter("Stormtrooper");
  addCharacter("Stormtrooper");
  addCharacter("Probot");
  playSound("MouseDroidSoundRandom");
  addPoints(25);
}
function whenGetProbot() {
  addCharacter("RebelPilot");
  addCharacter("Stormtrooper");
  addCharacter("Stormtrooper");
  playSound("ProbotSoundRandom");
  addPoints(50);
  setDroidSpeed("fast");
}
function whenGetStormtrooper() {
  endGame("lose");
  playSound("alert1");
  removePoints(100);
}
function whenGetRebelPilot() {
  endGame("win");
  playSound("R2-D2random");
  addPoints(100);
}
I put a lot of time and thought into this game so it wasn't just a bunch of random aliens forever spawning, and then crash the game cus there are thousands of them.  You actually need to collect the critter with getting killed by stormtroopers and save the rebel pilot.  This game makes sense and has a defined goal and story to it.
Be nice!!! 
I made a super awesome snowflake, you'll just have to take my word for it.

I did the Design one, all my animals had free range.  Zombies and Creepers always attack at night and my Iron Golem beats them up without me having to tell it.

No comments:

Post a Comment