Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24802 from code-dot-org/levelbuilder
DTS (Levelbuilder > Staging) [robo-dts]
- Loading branch information
Showing
44 changed files
with
3,612 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
dashboard/config/blocks/Dancelab/Dancelab_changeMoveEachLR.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
121
dashboard/config/blocks/Dancelab/Dancelab_changeMoveEachLR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
97
dashboard/config/blocks/Dancelab/Dancelab_changeMoveLR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
18
dashboard/config/blocks/Dancelab/Dancelab_changeMoveRight.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
79
dashboard/config/blocks/Dancelab/Dancelab_changeMoveRight.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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\"" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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);}); | ||
} |
Oops, something went wrong.