|
57 | 57 | "submittable": "false",
|
58 | 58 | "hide_view_data_button": "false",
|
59 | 59 | "debugger_disabled": "false",
|
60 |
| - "markdown_instructions": "# Getting faster at an angle\r\n\r\nHere's a different car that uses the same method of changing the velocity to make the car go faster, but it changes both `velocityX` and `velocityY`. What do you think will happen when you run the code?\r\n\r\n# Do This\r\n\r\nDiscuss with your partner what you think will happen when the code runs, then run it and see whether you were right. Why do you think the car moves in this way?\r\n\r\n[//]: #(https://images.code.org/4d1af9cc274f30b9d9263a47f9f64f13-image-1470941637433.png)", |
61 |
| - "start_blocks": "var sprite = createSprite(70,300);\r\nsprite.setAnimation(\"green_car\");\r\n// initialize the sprite's velocity\r\nsprite.velocityX = 0.8;\r\nsprite.velocityY = -0.3;\r\nsprite.rotateToDirection = true;\r\n\r\nfunction draw() {\r\n // change the sprite's velocity\r\n sprite.velocityX = sprite.velocityX + 0.1;\r\n sprite.velocityY = sprite.velocityY - 0.1;\r\n \r\n // draw the background\r\n background(\"green\");\r\n stroke(\"gray\");\r\n strokeWeight(70);\r\n line(0, 335, 400, 185);\r\n stroke(\"black\");\r\n strokeWeight(5);\r\n line(0, 370, 400, 220);\r\n line(0, 300, 400, 150);\r\n line(0, 335, 80, 305);\r\n line(160, 275, 240, 245);\r\n line(320, 215, 400, 185);\r\n \r\n \r\n drawSprites();\r\n}\r\n", |
| 60 | + "markdown_instructions": "# Getting faster at an angle\r\n\r\nHere's a different car that uses the same counter pattern to make the car go faster, but it changes both `velocityX` and `velocityY`. ([Show me where](#triggercallout=code_triggered)) It also prints the speed and direction to the debug console. What do you think will happen when you run the code?\r\n\r\n# Do This\r\n\r\nDiscuss with your partner what you think will happen when the code runs, then run it and see whether you were right. Why do you think the car moves in this way?\r\n\r\n[//]: #(https://images.code.org/4d1af9cc274f30b9d9263a47f9f64f13-image-1470941637433.png)", |
| 61 | + "start_blocks": "var car = createSprite(70,300);\r\ncar.setAnimation(\"green_car\");\r\n// initialize the sprite's velocity\r\ncar.velocityX = 0.8;\r\ncar.velocityY = -0.3;\r\ncar.rotateToDirection = true;\r\n\r\nfunction draw() {\r\n // draw the background\r\n background(\"green\");\r\n stroke(\"gray\");\r\n strokeWeight(70);\r\n line(0, 335, 400, 185);\r\n stroke(\"black\");\r\n strokeWeight(5);\r\n line(0, 370, 400, 220);\r\n line(0, 300, 400, 150);\r\n line(0, 335, 80, 305);\r\n line(160, 275, 240, 245);\r\n line(320, 215, 400, 185);\r\n \r\n // update the sprite's velocity\r\n car.velocityX = car.velocityX + 0.1;\r\n car.velocityY = car.velocityY - 0.1;\r\n // show the velocities in the debug console\r\n console.log(\"speed: \" + car.getSpeed() + \", dir: \" + car.getDirection());\r\n \r\n drawSprites();\r\n}\r\n", |
62 | 62 | "start_animations": "{\r\n \"orderedKeys\": [\"green_car\"],\r\n \"propsByKey\": {\r\n \"green_car\": {\r\n \"name\": \"green_car\",\r\n \"sourceUrl\": \"https://images.code.org/4d1af9cc274f30b9d9263a47f9f64f13-image-1470941637433.png\",\r\n \"frameSize\": {\"x\":100, \"y\": 50},\r\n \"frameCount\": 1,\r\n \"frameRate\": 15\r\n }\r\n }\r\n}",
|
63 | 63 | "pause_animations_by_default": "false",
|
| 64 | + "callout_json": "[\r\n {\r\n \"localization_key\": \"CSD_U3_L12_S4_C1\",\r\n \"callout_text\": \"The velocity is updated here.\",\r\n \"element_id\": \"\",\r\n \"on\": \"code_triggered\",\r\n \"qtip_config\": {\r\n \"codeStudio\": {\r\n \"canReappear\": true,\r\n \"dropletPaletteCategory\": \"\",\r\n \"codeString\": \"// change the sprite's velocity\"\r\n },\r\n \"style\": {\r\n \"classes\": \"\"\r\n },\r\n \"position\": {\r\n \"my\": \"right center\",\r\n \"at\": \"bottom left\",\r\n \"adjust\": {\r\n \"x\": 60,\r\n \"y\": 10\r\n }\r\n }\r\n }\r\n }\r\n]", |
64 | 65 | "contained_level_names": null
|
65 | 66 | },
|
66 | 67 | "published": true,
|
|
0 commit comments