Part 11b – Code.org Start Wars Game

Here is the Star Wars game. You win by getting all rebel pilots, lose by getting all storm troopers but when you lose you get a 10,000 point bonus. I call this game Millenniums Win.

 

 

setBackground(“Starship”);
setMap(“blobs”);
setDroid(“R2-D2”);
setDroidSpeed(“normal”);
playSound(“ProbotSound2”);

addCharacter(“Stormtrooper”);
addCharacter(“Stormtrooper”);
addCharacter(“RebelPilot”);
addCharacter(“RebelPilot”);
addCharacter(“RebelPilot”);
addCharacter(“MouseDroid”);
addCharacter(“MouseDroid”);
addCharacter(“MouseDroid”);
addCharacter(“MouseDroid”);
moveSlow(“MouseDroid”);
addCharacter(“Mynock”);
addCharacter(“Mynock”);
addCharacter(“Mynock”);
addCharacter(“Mynock”);
moveFast(“Mynock”);

function whenTouchObstacle() {
playSound(“alert1”);
removePoints(100);
}

function whenUp() {
goUp();
}
function whenDown() {
goDown();
}
function whenLeft() {
goLeft();
}
function whenRight() {
goRight();
}

function whenGetMynock() {
addCharacter(“MouseDroid”);
addCharacter(“MouseDroid”);
addCharacter(“Mynock”);
addPoints(1000);
}

function whenGetRebelPilot() {
addCharacter(“Stormtrooper”);
removePoints(50);
}

function whenGetAllStormtroopers(){
addPoints(10000);
goRight();
goRight();
goRight();
goRight();
goRight();
goRight();
goRight();
goRight();
goRight();
goRight();
goRight();
endGame(“lose”);
}

function whenGetCharacter() {
playSound(“C-3POsound3”);
}

function whenGetAllRebelPilots() {
addCharacter(“RebelPilot”);
addPoints(5000);
endGame(“win”);
}

function whenGetMouseDroid() {
addCharacter(“MouseDroid”);
addCharacter(“MouseDroid”);
addPoints(10);
}

You can play the game here: https://studio.code.org/c/333187252

Minecraft Exercise

My minecraft map includes a large farm and a large brick house.

turnRight();
for (var count = 0; count < 5; count++) {
moveForward();
}
turnLeft();
for (var count2 = 0; count2 < 4; count2++) {
moveForward();
}
turnLeft();
for (var count5 = 0; count5 < 3; count5++) {
for (var count3 = 0; count3 < 8; count3++) {
destroyBlock();
placeBlock(“farmlandWet”);
plantCrop();
moveForward();
}
turnLeft();
destroyBlock();
moveForward();
turnLeft();
for (var count4 = 0; count4 < 8; count4++) {
destroyBlock();
shear();
placeBlockAhead(“farmlandWet”);
plantCrop();
moveForward();
}
turnRight();
destroyBlock();
moveForward();
turnRight();
}
turnRight();
for (var count8 = 0; count8 < 4; count8++) {
for (var count6 = 0; count6 < 3; count6++) {
placeBlock(“bricks”);
}
placeBlock(“glass”);
for (var count7 = 0; count7 < 3; count7++) {
placeBlock(“bricks”);
}
turnLeft();
}
for (var count8 = 0; count8 < 4; count8++) {
for (var count6 = 0; count6 < 3; count6++) {
placeBlock(“bricks”);
}
placeBlock(“glass”);
for (var count7 = 0; count7 < 3; count7++) {
placeBlock(“bricks”);
}
turnLeft();
}
for (var count8 = 0; count8 < 4; count8++) {
for (var count6 = 0; count6 < 3; count6++) {
placeBlock(“bricks”);
}
placeBlock(“glass”);
for (var count7 = 0; count7 < 3; count7++) {
placeBlock(“bricks”);
}
turnLeft();
}
turnRight();
for (var count8 = 0; count8 < 4; count8++) {
for (var count6 = 0; count6 < 3; count6++) {
placeBlock(“gravel”);
}
placeBlock(“glass”);
for (var count7 = 0; count7 < 3; count7++) {
placeBlock(“bricks”);
}
turnLeft();
}
for (var count8 = 0; count8 < 4; count8++) {
for (var count6 = 0; count6 < 3; count6++) {
placeBlock(“bricks”);
}
placeBlock(“glass”);
for (var count7 = 0; count7 < 3; count7++) {
placeBlock(“bricks”);
}
turnLeft();
}
for (var count8 = 0; count8 < 4; count8++) {
for (var count6 = 0; count6 < 3; count6++) {
placeBlock(“bricks”);
}
placeBlock(“glass”);
for (var count7 = 0; count7 < 3; count7++) {
placeBlock(“bricks”);
}

turnLeft();

The game is located here: https://studio.code.org/c/333201953

Frozen Code Anna and Elsa Exercise

Here is my fabulous snowflake drawing: https://studio.code.org/c/49768924

And my lovely 4 degree drawing: https://studio.code.org/c/50197953

And another awesome snowflake: https://studio.code.org/c/51803719

And 20 overlapping circles: https://studio.code.org/c/53014217

And big and little circles: https://studio.code.org/c/48466434

Puzzle 19 8 Snowflakes: https://studio.code.org/c/53005426

Here is the code from my last exercise:

drawSnowflake(‘flower’);moveForward(125);
turnRight(90);
moveForward(125);
for (var count = 0; count < 4; count++) {
  penColour(colour_random());
  drawSnowflake(‘fractal’);turnRight(90);
  jumpForward(250);
}
turnRight(90);
moveForward(125);
turnRight(45);
for (var count2 = 0; count2 < 4; count2++) {
  drawSnowflake(‘parallelogram’);moveForward(200);
  turnRight(90);
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.