Skip to content

Commit

Permalink
Merge pull request #24802 from code-dot-org/levelbuilder
Browse files Browse the repository at this point in the history
DTS (Levelbuilder > Staging) [robo-dts]
  • Loading branch information
deploy-code-org committed Sep 14, 2018
2 parents 0368d28 + ec303b7 commit 3708f2e
Show file tree
Hide file tree
Showing 44 changed files with 3,612 additions and 215 deletions.
3 changes: 2 additions & 1 deletion dashboard/config/blocks/Dancelab/Dancelab_atTimestamp.json
Expand Up @@ -11,7 +11,8 @@
"args": [
{
"name": "TIMESTAMP",
"type": "Number"
"type": "Number",
"field": true
},
{
"name": "UNIT",
Expand Down
6 changes: 6 additions & 0 deletions dashboard/config/blocks/Dancelab/Dancelab_changeMoveEachLR.js
@@ -0,0 +1,6 @@
function changeMoveEachLR(group, move, dir) {
if (typeof(group) == "string") {
group = sprites_by_type[group];
}
group.forEach(function(sprite) { changeMoveLR(sprite, move, dir);});
}
121 changes: 121 additions & 0 deletions dashboard/config/blocks/Dancelab/Dancelab_changeMoveEachLR.json
@@ -0,0 +1,121 @@
{
"category": "Groups",
"config": {
"func": "changeMoveEachLR",
"blockText": "{GROUP} do {MOVE} {DIR} forever",
"color": [
270,
".7",
".7"
],
"args": [
{
"name": "GROUP",
"options": [
[
"all",
"sprites"
],
[
"all ducks",
"\"duck\""
],
[
"all moose",
"\"moose\""
],
[
"all unicorns",
"\"unicorn\""
],
[
"all Mr Wiggles",
"\"mrwiggles\""
],
[
"all cat",
"\"cat\""
]
]
},
{
"name": "MOVE",
"options": [
[
"Rest",
"0"
],
[
"Clap High",
"1"
],
[
"Clown",
"2"
],
[
"Dab",
"3"
],
[
"Double Jam",
"4"
],
[
"Drop",
"5"
],
[
"Floss",
"6"
],
[
"Fresh",
"7"
],
[
"Roll",
"8"
],
[
"This or That",
"9"
],
[
"Kick",
"10"
],
[
"Thiller",
"11"
],
[
"Next",
"\"next\""
],
[
"Previous",
"\"prev\""
],
[
"Random",
"\"rand\""
]
]
},
{
"name": "DIR",
"options": [
[
"",
"-1"
],
[
"",
"1"
]
]
}
]
}
}
15 changes: 15 additions & 0 deletions dashboard/config/blocks/Dancelab/Dancelab_changeMoveLR.js
@@ -0,0 +1,15 @@
function changeMoveLR(sprite, move, dir) {
if (move == "next") {
move = 1 + ((sprite.current_move + 1) % (dancers[sprite.style].length - 1));
} else if (move == "prev") {
move = 1 + ((sprite.current_move - 1) % (dancers[sprite.style].length - 1));
} else if (move == "rand") {
move = randomNumber(1, dancers[sprite.style].length - 1);
}
sprite.mirroring = dir;
sprite.mirrorX(dir);
sprite.changeAnimation("anim" + move);
if (sprite.animation.looping) sprite.looping_frame = 0;
sprite.animation.looping = true;
sprite.current_move = move;
}
97 changes: 97 additions & 0 deletions dashboard/config/blocks/Dancelab/Dancelab_changeMoveLR.json
@@ -0,0 +1,97 @@
{
"category": "Moves",
"config": {
"func": "changeMoveLR",
"blockText": "{SPRITE} do {MOVE} {DIR} forever",
"color": [
270,
".7",
".7"
],
"args": [
{
"name": "SPRITE",
"type": "Sprite",
"customInput": "spritePicker"
},
{
"name": "MOVE",
"options": [
[
"Rest",
"0"
],
[
"Clap High",
"1"
],
[
"Clown",
"2"
],
[
"Dab",
"3"
],
[
"Double Jam",
"4"
],
[
"Drop",
"5"
],
[
"Floss",
"6"
],
[
"Fresh",
"7"
],
[
"Roll",
"8"
],
[
"This or That",
"9"
],
[
"Kick",
"10"
],
[
"Thiller",
"11"
],
[
"Next",
"\"next\""
],
[
"Previous",
"\"prev\""
],
[
"Random",
"\"rand\""
]
]
},
{
"name": "DIR",
"options": [
[
"",
"-1"
],
[
"",
"1"
]
]
}
]
}
}
18 changes: 18 additions & 0 deletions dashboard/config/blocks/Dancelab/Dancelab_changeMoveRight.js
@@ -0,0 +1,18 @@
function changeMoveRight(sprite, move) {
if (move == "next") {
move = 1 + ((sprite.current_move + 1) % (dancers[sprite.style].length - 1));
} else if (move == "prev") {
move = 1 + ((sprite.current_move - 1) % (dancers[sprite.style].length - 1));
} else if (move == "rand") {
move = randomNumber(1, dancers[sprite.style].length - 1);
}
sprite.mirrorX(0);
sprite.changeAnimation("anim" + move);
if (animation.looping) sprite.looping_frame = 0;
sprite.animation.looping = true;
sprite.previous_move = sprite.current_move;
sprite.current_move = move;
sprite.frameDelay = sprite.dance_speed;
//sprite.animation.changeFrame(0);
sprite.animation.play();
}
79 changes: 79 additions & 0 deletions dashboard/config/blocks/Dancelab/Dancelab_changeMoveRight.json
@@ -0,0 +1,79 @@
{
"category": "Moves",
"config": {
"func": "changeMoveRight",
"blockText": "{SPRITE} repeating move {MOVE} [RIGHT]",
"args": [
{
"name": "SPRITE",
"type": "Sprite",
"customInput": "spritePicker"
},
{
"name": "MOVE",
"options": [
[
"Rest",
"0"
],
[
"Clap High",
"1"
],
[
"Clown",
"2"
],
[
"Dab",
"3"
],
[
"Double Jam",
"4"
],
[
"Drop",
"5"
],
[
"Floss",
"6"
],
[
"Fresh",
"7"
],
[
"Roll",
"8"
],
[
"This or That",
"9"
],
[
"Kick",
"10"
],
[
"Thiller",
"11"
],
[
"Next",
"\"next\""
],
[
"Previous",
"\"prev\""
],
[
"Random",
"\"rand\""
]
]
}
]
}
}
6 changes: 6 additions & 0 deletions dashboard/config/blocks/Dancelab/Dancelab_doMoveEachLR.js
@@ -0,0 +1,6 @@
function doMoveEachLR(group, move, dir) {
if (typeof(group) == "string") {
group = sprites_by_type[group];
}
group.forEach(function(sprite) { doMoveLR(sprite, move, dir);});
}

0 comments on commit 3708f2e

Please sign in to comment.