-
Notifications
You must be signed in to change notification settings - Fork 480
/
CSD U3 - complex - key up and down.level
123 lines (123 loc) · 5.15 KB
/
CSD U3 - complex - key up and down.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
<Gamelab>
<config><![CDATA[{
"game_id": 50,
"created_at": "2016-06-17T18:22:24.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,
"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,
"scale": null
},
"show_d_pad": "true",
"edit_code": true,
"embed": "false",
"markdown_instructions": "# Responding to a Single Click\r\n\r\nEarlier we learned that `keyWentDown` and `keyWentUp` can be used to respond to a keypress a single time. The blocks `mouseWentUp` and `mouseWentDown` allow you to do that for the mouse!\r\n\r\n# Do This\r\n\r\nLet's make a simple game that counts how many times you've clicked. We've already provided a variable `clicks` that you can use to track how many times the user has clicked.\r\n\r\n* Add a conditional that checks if the mouse went down.\r\n* Inside your conditional, add to the `clicks` variable.\r\n\r\n_Challenge: Can you add a sprite that responds to `mouseWentDown` as well? Add an image of your choice and increase the sprite's size each time the mouse is clicked._",
"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 clicks = 0;\r\n\r\nfunction draw() {\r\n // If mouseWentDown, add one to the clicks variable\r\n \r\n background(\"white\");\r\n textSize(50);\r\n textAlign(CENTER, CENTER);\r\n text(clicks, 0, 0, 400, 400);\r\n}",
"hide_animation_mode": "false",
"instructions_important": "false",
"show_debug_watch": "true",
"start_in_animation_tab": "false",
"all_animations_single_frame": "true",
"pause_animations_by_default": "false",
"encrypted_examples": "GGqTz/LS/qGOLBtfVNK4d5jNBO4JGJ/SYOo3LhKsnK2nBWNKo5o9PKAmtP0l\nrfkKI1TlXowEcwS1zxqSLmSdKA==\n",
"hide_share_and_remix": "false",
"disable_if_else_editing": "false",
"expand_debugger": "false",
"disable_procedure_autopopulate": "false",
"contained_level_names": null
},
"published": true,
"notes": "",
"audit_log": "[{\"changed_at\":\"2017-11-07 17:48:27 +0000\",\"changed\":[\"code_functions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":568,\"changed_by_email\":\"meilani.eyre@code.org\"},{\"changed_at\":\"2017-11-07 17:49:43 +0000\",\"changed\":[\"code_functions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":568,\"changed_by_email\":\"meilani.eyre@code.org\"},{\"changed_at\":\"2017-11-07 17:51:41 +0000\",\"changed\":[\"code_functions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":568,\"changed_by_email\":\"meilani.eyre@code.org\"},{\"changed_at\":\"2017-11-07 18:00:00 +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>