Saturday, December 22, 2018

Coding Fun

I am teaching an overview of Emerging Technologies for Teaching next semester and just wanted to share an excerpt from one of the modules.

My friend from New York just sent me a link (actually she tweeted it to all her many Twitter friends). Check it out and watch her robot (and a couple of sharks) dance to Cheap Thrills by Sia.
dance

By clicking the "How it Works" button at the bottom, you will be able to create your own and join code.org (Links to an external site.)Links to an external site. along with millions of teachers around the world who are bringing coding to children (and adults) of all ages.
Here is the code for this particular dancing robot show.
BlocklyDance
Of course, this is in Blockly, if you want to see the real JavaScript code behind the curtain, so to speak, it looks like this:
var dancer1;

whenSetup(function () {
  setBackgroundEffectWithPalette("sparkles", "rave");
  makeNewDanceSpriteGroup(2, "SHARK", "row");
  changeMoveEachLR("SHARK", MOVES.DoubleJam, -1);
  dancer1 = makeNewDanceSprite("ROBOT", dancer1, {x: 200, y: 200});
  changeMoveLR(dancer1, "rand", -1);
});

atTimestamp(6, "measures", function () {
  changeMoveEachLR(sprites, MOVES.Dab, -1);
});

atTimestamp(8, "measures", function () {
  changeMoveEachLR(sprites, MOVES.Roll, -1);
});

atTimestamp(10, "measures", function () {
  changeMoveEachLR(sprites, MOVES.Clown, -1);
});

atTimestamp(4, "measures", function () {
  changeMoveEachLR(sprites, MOVES.Drop, -1);
});
Once you click "ReMix" you will be prompted to join code.org. Please do so.
You will then be able to modify the code for the dance, change the song, change the characters, change the dance, and more. Be experimental and click the drop-down boxes to modify the types and numbers of characters. With a few clicks, I added 8 dancing dogs under a disco ball being led by a moose in a jacket. 
Dance Moose
Play around with the code and SHARE your resulting dance with me. The level of complexity is up to you and, just remember, this is what students today are learning how to do. Blockly is the gateway to JavaScript.
Have fun.

No comments:

Post a Comment

LTEC Program Update

It is with heavy hearts that we inform you that as of Fall 2018, the LTEC/COLT graduate programs have been shelved and we will no longer be ...