-
Notifications
You must be signed in to change notification settings - Fork 479
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 #24142 from code-dot-org/levelbuilder
DTS (Levelbuilder > Staging) [robo-dts]
- Loading branch information
Showing
88 changed files
with
10,674 additions
and
207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function atTimestamp(timestamp, event) { | ||
registerSetup(function() { | ||
Dance.song.addCue(0, timestamp, event); | ||
}); | ||
} |
19 changes: 19 additions & 0 deletions
19
dashboard/config/blocks/Dancelab/Dancelab_atTimestamp.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,19 @@ | ||
{ | ||
"category": "Events", | ||
"config": { | ||
"color": [ | ||
140, | ||
1, | ||
0.74 | ||
], | ||
"func": "atTimestamp", | ||
"blockText": "at {TIMESTAMP} seconds", | ||
"args": [ | ||
{ | ||
"name": "TIMESTAMP", | ||
"type": "Number" | ||
} | ||
], | ||
"eventBlock": true | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
dashboard/config/blocks/Dancelab/Dancelab_changeColorBy.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,14 @@ | ||
function changeColorBy(input, method, amount) { | ||
push(); | ||
colorMode(HSB, 100); | ||
var c = color(input); | ||
var hsb = { | ||
hue: c._getHue(), | ||
saturation: c._getSaturation(), | ||
brightness: c._getBrightness() | ||
}; | ||
hsb[method] = Math.round((hsb[method] + amount) % 100); | ||
var new_c = color(hsb.hue, hsb.saturation, hsb.brightness); | ||
pop(); | ||
return new_c; | ||
} |
35 changes: 35 additions & 0 deletions
35
dashboard/config/blocks/Dancelab/Dancelab_changeColorBy.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,35 @@ | ||
{ | ||
"category": "World", | ||
"config": { | ||
"func": "changeColorBy", | ||
"blockText": "change {COLOR} {METHOD} by {AMOUNT}", | ||
"returnType": "Colour", | ||
"args": [ | ||
{ | ||
"name": "COLOR", | ||
"type": "Colour" | ||
}, | ||
{ | ||
"name": "METHOD", | ||
"options": [ | ||
[ | ||
"hue", | ||
"\"hue\"" | ||
], | ||
[ | ||
"saturation", | ||
"\"saturation\"" | ||
], | ||
[ | ||
"brightness", | ||
"\"brightness\"" | ||
] | ||
] | ||
}, | ||
{ | ||
"name": "AMOUNT", | ||
"type": "Number" | ||
} | ||
] | ||
} | ||
} |
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 changePropBy(sprite, property, val) { | ||
if (!sprite || val === undefined) { | ||
return; | ||
} | ||
if (property == "scale") { | ||
sprite.scale += val/100; | ||
if (sprite.scale < 0) { | ||
sprite.scale = 0; | ||
} | ||
} else if (property == "tint") { | ||
sprite.tint = changeColorBy(sprite.tint, "hue", val); | ||
} | ||
else if (property=="direction") { | ||
sprite.direction = getDirection(sprite) + val; | ||
} else { | ||
sprite[property] += val; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
dashboard/config/blocks/Dancelab/Dancelab_changePropBy.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,46 @@ | ||
{ | ||
"category": "Sprites", | ||
"config": { | ||
"func": "changePropBy", | ||
"blockText": "change {SPRITE} {PROPERTY} by {VAL}", | ||
"args": [ | ||
{ | ||
"name": "SPRITE", | ||
"type": "Sprite" | ||
}, | ||
{ | ||
"name": "PROPERTY", | ||
"options": [ | ||
[ | ||
"size", | ||
"\"scale\"" | ||
], | ||
[ | ||
"rotation", | ||
"\"rotation\"" | ||
], | ||
[ | ||
"x position", | ||
"\"x\"" | ||
], | ||
[ | ||
"y position", | ||
"\"y\"" | ||
], | ||
[ | ||
"movement direction", | ||
"\"direction\"" | ||
], | ||
[ | ||
"tint", | ||
"\"tint\"" | ||
] | ||
] | ||
}, | ||
{ | ||
"name": "VAL", | ||
"type": "Number" | ||
} | ||
] | ||
} | ||
} |
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,3 @@ | ||
function clickedOn(sprite, event) { | ||
touchEvents.push({type: mousePressedOver, event: event, sprite: sprite}); | ||
} |
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,20 @@ | ||
{ | ||
"category": "Events", | ||
"config": { | ||
"color": [ | ||
140, | ||
1, | ||
0.74 | ||
], | ||
"func": "clickedOn", | ||
"blockText": "when {SPRITE} clicked", | ||
"args": [ | ||
{ | ||
"name": "SPRITE", | ||
"type": "Sprite", | ||
"defer": true | ||
} | ||
], | ||
"eventBlock": true | ||
} | ||
} |
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,13 @@ | ||
{ | ||
"category": "", | ||
"config": { | ||
"func": "frameRate", | ||
"blockText": "set framerate to {RATE}", | ||
"args": [ | ||
{ | ||
"name": "RATE", | ||
"type": "Number" | ||
} | ||
] | ||
} | ||
} |
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,14 @@ | ||
function getProp(sprite, property) { | ||
if (!sprite) { | ||
return undefined; | ||
} | ||
if (property=="scale") { | ||
return sprite.scale*100; | ||
} else if (property=="costume") { | ||
return sprite.getAnimationLabel(); | ||
} else if (property=="direction") { | ||
return getDirection(sprite); | ||
} else { | ||
return sprite[property]; | ||
} | ||
} |
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,48 @@ | ||
{ | ||
"category": "Sprites", | ||
"config": { | ||
"func": "getProp", | ||
"blockText": "{SPRITE} {PROPERTY}", | ||
"returnType": "None", | ||
"color": [ | ||
258, | ||
"0.35", | ||
"0.62" | ||
], | ||
"args": [ | ||
{ | ||
"name": "SPRITE", | ||
"type": "Sprite" | ||
}, | ||
{ | ||
"name": "PROPERTY", | ||
"options": [ | ||
[ | ||
"size", | ||
"\"scale\"" | ||
], | ||
[ | ||
"rotation", | ||
"\"rotation\"" | ||
], | ||
[ | ||
"x position", | ||
"\"x\"" | ||
], | ||
[ | ||
"y position", | ||
"\"y\"" | ||
], | ||
[ | ||
"movement direction", | ||
"\"direction\"" | ||
], | ||
[ | ||
"tint", | ||
"\"tint\"" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} |
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,20 @@ | ||
{ | ||
"category": "Logic", | ||
"config": { | ||
"func": "isTouching", | ||
"blockText": "{THIS} is touching {TARGET}", | ||
"args": [ | ||
{ | ||
"name": "TARGET", | ||
"type": "Sprite" | ||
} | ||
], | ||
"methodCall": true, | ||
"returnType": "Boolean", | ||
"color": [ | ||
197, | ||
0.88, | ||
0.78 | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
function mixColors(color1, color2) { | ||
return lerpColor(color(color1), color(color2), 0.5); | ||
} |
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,21 @@ | ||
{ | ||
"category": "World", | ||
"config": { | ||
"func": "mixColors", | ||
"blockText": "mix {COLOR1} and {COLOR2}", | ||
"args": [ | ||
{ | ||
"name": "COLOR1" | ||
}, | ||
{ | ||
"name": "COLOR2" | ||
} | ||
], | ||
"returnType": "Colour", | ||
"color": [ | ||
196, | ||
1, | ||
0.79 | ||
] | ||
} | ||
} |
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,16 @@ | ||
{ | ||
"category": "Sprites", | ||
"config": { | ||
"color": [ | ||
184, | ||
1, | ||
0.74 | ||
], | ||
"func": "moveDown", | ||
"blockText": "{THIS} move down", | ||
"args": [ | ||
|
||
], | ||
"methodCall": true | ||
} | ||
} |
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,5 @@ | ||
function moveForward(sprite, distance) { | ||
var direction = getDirection(sprite); | ||
sprite.x += distance * Math.cos(direction * Math.PI / 180); | ||
sprite.y += distance * Math.sin(direction * Math.PI / 180); | ||
} |
Oops, something went wrong.