{"id":51956,"student_id":1444,"content":"setBackdrop(\"#222222\");\nvar player = createSprite(\"player.png\");\nvar ball = createSprite(\"ball.png\");\nvar score = 0;\nvar lives = 3;\nvar speed = 5;\nvar level = 1;\n\nplayer.y = 450;\nball.direction = 180;\n\nvar blocks = [];\n\ninitBlocks();\n\nforever(function () {\n print(\"Score: \" + score, 20, 20, \"white\");\n print(\"Lives: \" + lives, 20, 40, \"white\");\n print(\"Level: \" + level, 20, 60, \"white\");\n\n player.x = cursor.x;\n ball.stepForward(speed);\n ball.bounceEdge();\n // touched();\n if (ball.y \u003e= 480) {\n ball.direction = 180;\n ball.x = 320;\n ball.y = 240;\n speed = 5;\n lives--;\n }\n if (lives \u003c= 0) {\n print('Game Over', 170, 200, 'white', 60);\n stop();\n }\n});\nfunction initBlocks () {\n for (var j = 0; j \u003c 6; j++) {\n for (var i = 0; i \u003c 10; i++) {\n var block = createSprite([\"b0.png\", \"b1.png\", \"b2.png\", \"b3.png\", \"b4.png\", \"b5.png\"]);\n block.costumeId = Math.floor(Math.random()*6);\n block.x = i * 64 + 32;\n block.y = j * 32 + 16;\n blocks.push(block);\n }\n }\n}\n\n// function touched(){\n// if(ball.touched(blocks) == true){\n// ball.direction = -ball.direction + 180 + Math.random() * 20 - 10;\n// block.destroy();\n// score++;\n// if (blocks.length \u003c= 0) {\n// initBlocks();\n// level++;\n// }\n// }\n// if(ball.touched(player) == true){\n// ball.direction = -ball.direction + 180 + Math.random() * 20 - 10;\n// ball.y = player.y - 27;\n// if (speed \u003c 5 + level*2) speed += 1;\n// }\n// }\n\nball.on('touch', blocks, function (block) {\n ball.direction = -ball.direction + 180 + Math.random() * 20 - 10;\n block.destroy();\n score++;\n if (blocks.length \u003c= 0) {\n initBlocks();\n level++;\n }\n});\n\nball.on('touch', player, function () {\n ball.direction = -ball.direction + 180 + Math.random() * 20 - 10;\n ball.y = player.y - 27;\n if (speed \u003c 5 + level*2) speed += 1;\n});","created_at":"2018-12-13T02:52:18.600+08:00","updated_at":"2019-11-11T16:06:10.826+08:00","name":"breakout(試玩版 較高級)","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/51956/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":117,"hashid":"jzmsr35k","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":926952,"file_name":"player.png","project_id":51956,"asset_id":103539,"created_at":"2018-12-13T02:54:01.390+08:00","updated_at":"2018-12-13T02:54:01.390+08:00"},{"id":926953,"file_name":"ball.png","project_id":51956,"asset_id":103540,"created_at":"2018-12-13T02:54:01.396+08:00","updated_at":"2018-12-13T02:54:01.396+08:00"},{"id":926954,"file_name":"b0.png","project_id":51956,"asset_id":103541,"created_at":"2018-12-13T02:54:01.403+08:00","updated_at":"2018-12-13T02:54:01.403+08:00"},{"id":926955,"file_name":"b1.png","project_id":51956,"asset_id":103542,"created_at":"2018-12-13T02:54:01.409+08:00","updated_at":"2018-12-13T02:54:01.409+08:00"},{"id":926956,"file_name":"b2.png","project_id":51956,"asset_id":103543,"created_at":"2018-12-13T02:54:01.416+08:00","updated_at":"2018-12-13T02:54:01.416+08:00"},{"id":926957,"file_name":"b3.png","project_id":51956,"asset_id":103544,"created_at":"2018-12-13T02:54:01.422+08:00","updated_at":"2018-12-13T02:54:01.422+08:00"},{"id":926958,"file_name":"b4.png","project_id":51956,"asset_id":103545,"created_at":"2018-12-13T02:54:01.428+08:00","updated_at":"2018-12-13T02:54:01.428+08:00"},{"id":926959,"file_name":"b5.png","project_id":51956,"asset_id":103546,"created_at":"2018-12-13T02:54:01.437+08:00","updated_at":"2018-12-13T02:54:01.437+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦