{"id":8201,"student_id":1470,"content":"var x = 320,\n y = 240,\n vx = 0,\n vy = 0;\nvar locationArr = [];\nsetBackdrop(\"DARKKHAKI\");\nvar leftKnob = createSprite({\n x: 50,\n y: 400,\n costumes: [\"Knob.png\", \"KnobGlowing.png\"],\n \n});\nvar rightKnob = createSprite({\n x: 550,\n y: 400,\n costumes: [\"Knob.png\", \"KnobGlowing.png\"],\n \n});\n\nvar pen = Game.pen;\n \npen.color = \"black\";\npen.size = 1;\n\n\nforever(function(){\n if(key.up || key.down){\n if(key.up){\n vy -= 1;\n } else {\n vy += 1;\n }\n \n //leftKnob.costumeId = 1;\n leftKnob.scale = 1.2;\n } else {\n //leftKnob.costumeId = 0;\n leftKnob.scale = 1;\n }\n \n if(key.left || key.right){\n if(key.left){\n vx -= 1;\n } else {\n vx += 1;\n }\n \n //rightKnob.costumeId = 1;\n rightKnob.scale = 1.2;\n } else {\n //rightKnob.costumeId = 0;\n rightKnob.scale = 1;\n }\n \n if(x + vx != x || y + vy != y){ //If I am moving. There is no need to push if I'm not moving\n locationArr.push({x1: x, y1: y, x2: x + vx, y2: y + vy});\n }\n \n for(var i = 0 ; i \u003c locationArr.length; i++){\n pen.drawLine(locationArr[i].x1, locationArr[i].y1, locationArr[i].x2, locationArr[i].y2);\n }\n x += vx;\n y += vy;\n vx = 0;\n vy = 0;\n});\n","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-08T03:33:45.260+08:00","name":"Etch A Sketch","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/8201/398730f3b14d7485bbeea4323f4551f3.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[1437],"is_featured":false,"views":573,"hashid":"kdmskm4","is_content_changed":null,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":182052,"file_name":"Knob.png","project_id":8201,"asset_id":22082,"created_at":"2017-07-25T14:12:49.626+08:00","updated_at":"2017-07-25T14:12:49.626+08:00"},{"id":182053,"file_name":"KnobGlowing.png","project_id":8201,"asset_id":22083,"created_at":"2017-07-25T14:12:49.628+08:00","updated_at":"2017-07-25T14:12:49.628+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦