-
Notifications
You must be signed in to change notification settings - Fork 480
/
CSD U3 - complex - mouse move.level
124 lines (124 loc) · 5.2 KB
/
CSD U3 - complex - mouse move.level
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<Gamelab>
<config><![CDATA[{
"game_id": 50,
"created_at": "2016-06-17T18:33:06.000Z",
"level_num": "custom",
"user_id": 1,
"properties": {
"skin": "gamelab",
"code_functions": {
"draw": null,
"drawSprites": null,
"World.mouseX": null,
"World.mouseY": null,
"World.frameRate": null,
"keyDown": null,
"keyWentUp": null,
"keyWentDown": null,
"mouseDown": null,
"mouseWentUp": null,
"mouseWentDown": null,
"mouseDidMove": null,
"var sprite = createSprite": null,
"setAnimation": null,
"sprite.height": null,
"sprite.width": null,
"x": null,
"y": null,
"rotation": null,
"shapeColor": null,
"background": null,
"fill": null,
"noFill": null,
"stroke": null,
"strokeWeight": null,
"noStroke": null,
"color": null,
"arc": null,
"ellipse": null,
"line": null,
"point": null,
"rect": null,
"regularPolygon": null,
"shape": null,
"text": null,
"textAlign": null,
"textFont": null,
"textSize": null,
"ifBlock": null,
"ifElseBlock": null,
"addOperator": null,
"subtractOperator": null,
"multiplyOperator": null,
"divideOperator": null,
"equalityOperator": null,
"inequalityOperator": null,
"greaterThanOperator": null,
"greaterThanOrEqualOperator": null,
"lessThanOperator": null,
"lessThanOrEqualOperator": null,
"andOperator": null,
"orOperator": null,
"notOperator": null,
"randomNumber_min_max": null,
"declareAssign_x": null,
"declareNoAssign_x": null,
"assign_x": null,
"comment_Sprites": null,
"comment_GameLab": null,
"comment_Variables": null,
"comment_Math": null,
"comment_Control": null,
"comment_Drawing": null,
"console.log": null
},
"show_d_pad": "true",
"edit_code": true,
"embed": "false",
"markdown_instructions": "# mouseDidMove\r\n\r\nWe can also use Boolean expressions to check whether or not the mouse has moved. The `mouseDidMove` block will return `false` if the mouse is still, but `true` if the mouse has been moving.\r\n\r\n# Do This\r\nRight now, this program just displays a salt shaker sprite. You'll need to use `mouseDidMove` so that you can \"shake\" the salt by moving the mouse back and forth.\r\n\r\n* Add a conditional that checks if `mouseDidMove`.\r\n* If the conditional is true, rotate the salt sprite randomly to the left or right.\r\n\r\n_Challenge: Can you keep track of how many times the `mouseDidMove` shakes the salt, and then rotate it right side up after 100 shakes?_",
"is_k1": "false",
"skip_instructions_popup": "false",
"never_autoplay_video": "false",
"disable_param_editing": "true",
"disable_variable_editing": "false",
"use_modal_function_editor": "false",
"use_contract_editor": "false",
"contract_highlight": "false",
"contract_collapse": "false",
"examples_highlight": "false",
"examples_collapse": "false",
"examples_required": "false",
"definition_highlight": "false",
"definition_collapse": "false",
"disable_examples": "false",
"droplet_tooltips_disabled": "false",
"lock_zero_param_functions": "false",
"free_play": "true",
"text_mode_at_start": "false",
"submittable": "false",
"hide_view_data_button": "true",
"debugger_disabled": "true",
"callout_json": "[]",
"start_blocks": "var salt = createSprite (200, 200);\r\nsalt.setAnimation(\"salt\");\r\nsalt.rotation = 150;\r\n\r\nfunction draw() {\r\n background(\"skyblue\");\r\n \r\n // If mouseDidMove, rotate the salt randomly to the left or right\r\n \r\n drawSprites();\r\n}",
"hide_animation_mode": "false",
"start_animations": "{\r\n \"orderedKeys\": [\r\n \"30cff2ca-74f5-47a9-b863-d3777b89b368\"\r\n ],\r\n \"propsByKey\": {\r\n \"30cff2ca-74f5-47a9-b863-d3777b89b368\": {\r\n \"name\": \"salt\",\r\n \"sourceUrl\": \"https://levelbuilder-studio.code.org/v3/animations/z_qn83ftD6Be6o4jqROXGw/30cff2ca-74f5-47a9-b863-d3777b89b368.png?version=pD_G4aOqeo06a7_kV.wGAvOPmupLzWAU\",\r\n \"frameSize\": {\r\n \"x\": 95,\r\n \"y\": 95\r\n },\r\n \"frameCount\": 1,\r\n \"looping\": true,\r\n \"frameDelay\": 2,\r\n \"version\": \"pD_G4aOqeo06a7_kV.wGAvOPmupLzWAU\"\r\n }\r\n }\r\n}",
"instructions_important": "false",
"start_in_animation_tab": "false",
"all_animations_single_frame": "true",
"pause_animations_by_default": "false",
"show_debug_watch": "true",
"encrypted_examples": "fVZMA7Efomof8brcEzPrdGlmNidkuzURQWCpztFQevjhxT4/QjkvC//j2HEM\nB35c4n5YsYQFKJGPNTS1WOXDAw==\n",
"disable_procedure_autopopulate": "false",
"hide_share_and_remix": "false",
"disable_if_else_editing": "false",
"expand_debugger": "false",
"contained_level_names": null
},
"published": true,
"notes": "",
"audit_log": "[{\"changed_at\":\"2017-11-02 16:56:44 +0000\",\"changed\":[\"code_functions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":568,\"changed_by_email\":\"meilani.eyre@code.org\"}]",
"level_concept_difficulty": {
}
}]]></config>
<blocks/>
</Gamelab>