Skip to content

Commit

Permalink
Merge pull request #20837 from code-dot-org/staging
Browse files Browse the repository at this point in the history
DTT (Staging > Test) [robo-dtt]
  • Loading branch information
deploy-code-org committed Feb 22, 2018
2 parents 8f9c8e0 + 5c14f56 commit 5edb30f
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apps/src/gamelab/blocks.js
Expand Up @@ -7,6 +7,7 @@ const SPRITE_CATEGORY = 'sprites';
const EVENT_CATEGORY = 'events';
const EVENT_LOOP_CATEGORY = 'event_loop';
const VARIABLES_CATEGORY = 'variables';
const WORLD_CATEGORY = 'world';
const CATEGORIES = {
[SPRITE_CATEGORY]: {
color: [184, 1.00, 0.74],
Expand All @@ -20,6 +21,9 @@ const CATEGORIES = {
[VARIABLES_CATEGORY]: {
color: [312, 0.32, 0.62],
},
[WORLD_CATEGORY]: {
color: [240, 0.45, 0.65],
},
};

const SPRITES = [
Expand Down Expand Up @@ -304,5 +308,24 @@ export default {
blockText: 'second touched sprite',
returnType: SPRITE_TYPE,
});

createJsWrapperBlock({
category: SPRITE_CATEGORY,
expression: 'length',
orderPrecedence: ORDER_MEMBER,
name: 'groupLength',
blockText: 'number of sprites in {THIS}',
methodCall: true,
returnType: blockly.BlockValueType.NUMBER,
});

createJsWrapperBlock({
category: WORLD_CATEGORY,
func: 'setBackground',
blockText: 'set background color {COLOR}',
args: [
{ name: 'COLOR', type: blockly.BlockValueType.COLOUR },
],
});
},
};
8 changes: 8 additions & 0 deletions dashboard/app/models/levels/gamelab_jr.rb
Expand Up @@ -52,6 +52,13 @@ def common_blocks(type)
<block type="when_run" />
</category>
<category name="Variables" custom="VARIABLE" />
<category name="World">
<block type="gamelab_setBackground">
<value name="COLOR">
<block type="colour_picker"></block>
</value>
</block>
</category>
<category name="Sprites">
<block type="gamelab_makeNewSprite" />
<block type="gamelab_moveUp" />
Expand All @@ -66,6 +73,7 @@ def common_blocks(type)
<category name="Groups">
<block type="gamelab_makeNewGroup" />
<block type="gamelab_add" />
<block type="gamelab_groupLength" />
</category>
<category name="Events">
<block type="gamelab_whenUpArrow" />
Expand Down
23 changes: 23 additions & 0 deletions dashboard/config/scripts/levels/New Game Lab Jr Project.level
Expand Up @@ -231,6 +231,15 @@
<category name="Start">
<block type="when_run"/>
</category>
<category name="World">
<block type="gamelab_setBackground" inline="true">
<value name="COLOR">
<block type="colour_picker">
<title name="COLOUR">#ff0000</title>
</block>
</value>
</block>
</category>
<category name="Sprites">
<block type="variables_set" inline="false">
<title name="VAR">sprite</title>
Expand Down Expand Up @@ -317,6 +326,7 @@
</block>
</value>
</block>
<block type="gamelab_groupLength" inline="true"/>
</category>
<category name="Events">
<block type="gamelab_whenUpArrow"/>
Expand Down Expand Up @@ -387,6 +397,19 @@
</value>
</block>
</category>
<category name="Logic">
<block type="controls_if" inline="false"/>
<block type="logic_compare" inline="true">
<title name="OP">EQ</title>
</block>
<block type="logic_operation" inline="true">
<title name="OP">AND</title>
</block>
<block type="logic_negate" inline="false"/>
<block type="logic_boolean">
<title name="BOOL">TRUE</title>
</block>
</category>
</xml>
</toolbox_blocks>
</blocks>
Expand Down

0 comments on commit 5edb30f

Please sign in to comment.