{"id":114766,"student_id":10,"content":"setBackdrop('#222222');\nvar player = createSprite('p0.png', 'p1.png', 'p2.png', 'p3.png', 'p4.png', 'p5.png');\nvar ball = createSprite('ball.png');\nvar hint = createSprite('hint.png');\nvar gameover = createSprite('gameover.png');\nvar score = 0;\nvar speed = 10;\nvar blocks = [];\nvar combo = 0;\n\nplayer.y = 860;\nball.y = 700;\nball.direction = 0;\ngameover.hidden = true;\ngameover.layer = 1;\nhint.layer = 2;\n\nfor (var y = 0; y \u003c 5; y++) {\n for (var x = 0; x \u003c 10; x++) {\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 = x*120 + 60;\n block.y = y*60 - 30;\n blocks.unshift(block);\n }\n}\n\nsound.play('bgm.mp3', true);\n\nwhen('click', start);\nfunction start () {\n forever(loop);\n hint.hidden = true;\n}\n\nfunction loop () {\n print('Score: ' + score, 20, 20, 'white', 40);\n\n player.x = cursor.x;\n ball.stepForward(speed);\n ball.bounceEdge();\n\n if (ball.y \u003e= 850) {\n ball.direction = 0;\n ball.moveTo(600, 450);\n speed = 10;\n }\n \n for (var i = 0; i \u003c blocks.length; i++) {\n var b = blocks[i];\n b.y += 0.1;\n \n if (b.y \u003e 700 \u0026\u0026 b.hidden == false) {\n for (var i = 0; i \u003c blocks.length; i++) {\n blocks[i].costumeId = 1;\n }\n stop();\n gameover.hidden = false;\n }\n\n if (b.touched(ball)) {\n b.hidden = true;\n ball.direction = -ball.direction + 180 + Math.random()*15;\n speed += 0.1;\n \n if (player.costumeId == b.costumeId) {\n player.nextCostume();\n combo++;\n } else {\n player.costumeId = b.costumeId;\n player.nextCostume();\n combo = 0;\n }\n \n if (combo == 0) {\n score += 1;\n createSound('1.mp3');\n }\n if (combo == 1) {\n score += 10;\n createSound('2.mp3');\n }\n if (combo == 2) {\n score += 50;\n createSound('3.mp3');\n }\n if (combo == 3) {\n score += 300;\n createSound('4.mp3');\n }\n if (combo == 4) {\n score += 1000;\n createSound('5.mp3');\n }\n if (combo \u003e= 5) {\n score += 5000;\n createSound('6.mp3');\n }\n }\n }\n \n if (ball.touched(player)) {\n ball.direction = (ball.x - player.x)/3;\n ball.y = 800;\n sound.play('hit2.wav');\n }\n \n if (blocks[0].y \u003e= 30) {\n for (var i=0; i\u003c10; 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*120 + 60;\n block.y = -30;\n blocks.unshift(block);\n }\n }\n \n pen.color = 'white';\n pen.drawLine(0, 700, 1200, 700);\n};","created_at":"2019-12-16T15:57:52.292+08:00","updated_at":"2020-07-11T20:37:55.658+08:00","name":"打磚塊_修改版","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/114766/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":3,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":259,"hashid":"zpes6k3j","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1962202,"file_name":"bgm.mp3","project_id":114766,"asset_id":172287,"created_at":"2019-12-16T22:56:54.394+08:00","updated_at":"2019-12-16T22:56:59.230+08:00"},{"id":1962199,"file_name":"hit2.wav","project_id":114766,"asset_id":172284,"created_at":"2019-12-16T22:49:16.455+08:00","updated_at":"2019-12-16T22:49:22.131+08:00"},{"id":2493660,"file_name":"7.mp3","project_id":114766,"asset_id":209242,"created_at":"2020-04-28T17:40:48.373+08:00","updated_at":"2020-04-28T17:40:48.373+08:00"},{"id":2494268,"file_name":"hint.png","project_id":114766,"asset_id":209382,"created_at":"2020-04-29T11:47:47.364+08:00","updated_at":"2020-04-29T11:47:47.364+08:00"},{"id":2494150,"file_name":"b2.png","project_id":114766,"asset_id":209304,"created_at":"2020-04-29T00:26:45.119+08:00","updated_at":"2020-04-29T00:26:45.119+08:00"},{"id":2494151,"file_name":"b3.png","project_id":114766,"asset_id":209305,"created_at":"2020-04-29T00:26:45.120+08:00","updated_at":"2020-04-29T00:26:45.120+08:00"},{"id":2494263,"file_name":"p2.png","project_id":114766,"asset_id":209371,"created_at":"2020-04-29T10:30:43.012+08:00","updated_at":"2020-04-29T10:30:43.012+08:00"},{"id":2494264,"file_name":"p3.png","project_id":114766,"asset_id":209372,"created_at":"2020-04-29T10:30:43.013+08:00","updated_at":"2020-04-29T10:30:43.013+08:00"},{"id":2494154,"file_name":"ball.png","project_id":114766,"asset_id":209308,"created_at":"2020-04-29T00:26:45.871+08:00","updated_at":"2020-04-29T00:26:45.871+08:00"},{"id":2494155,"file_name":"player.png","project_id":114766,"asset_id":209309,"created_at":"2020-04-29T00:26:45.872+08:00","updated_at":"2020-04-29T00:26:45.872+08:00"},{"id":2493654,"file_name":"1.mp3","project_id":114766,"asset_id":209236,"created_at":"2020-04-28T17:40:46.468+08:00","updated_at":"2020-04-28T17:40:46.468+08:00"},{"id":2493655,"file_name":"2.mp3","project_id":114766,"asset_id":209237,"created_at":"2020-04-28T17:40:46.470+08:00","updated_at":"2020-04-28T17:40:46.470+08:00"},{"id":2494210,"file_name":"line.jpg","project_id":114766,"asset_id":209361,"created_at":"2020-04-29T09:54:16.270+08:00","updated_at":"2020-04-29T09:54:16.270+08:00"},{"id":2494267,"file_name":"gameover.png","project_id":114766,"asset_id":209381,"created_at":"2020-04-29T11:28:20.844+08:00","updated_at":"2020-04-29T11:28:20.844+08:00"},{"id":2494261,"file_name":"p0.png","project_id":114766,"asset_id":209369,"created_at":"2020-04-29T10:30:42.665+08:00","updated_at":"2020-04-29T10:30:42.665+08:00"},{"id":2494262,"file_name":"p1.png","project_id":114766,"asset_id":209370,"created_at":"2020-04-29T10:30:42.666+08:00","updated_at":"2020-04-29T10:30:42.666+08:00"},{"id":2493656,"file_name":"3.mp3","project_id":114766,"asset_id":209238,"created_at":"2020-04-28T17:40:47.061+08:00","updated_at":"2020-04-28T17:40:47.061+08:00"},{"id":2493657,"file_name":"4.mp3","project_id":114766,"asset_id":209239,"created_at":"2020-04-28T17:40:47.062+08:00","updated_at":"2020-04-28T17:40:47.062+08:00"},{"id":2493658,"file_name":"5.mp3","project_id":114766,"asset_id":209240,"created_at":"2020-04-28T17:40:47.699+08:00","updated_at":"2020-04-28T17:40:47.699+08:00"},{"id":2493659,"file_name":"6.mp3","project_id":114766,"asset_id":209241,"created_at":"2020-04-28T17:40:47.701+08:00","updated_at":"2020-04-28T17:40:47.701+08:00"},{"id":2494148,"file_name":"b0.png","project_id":114766,"asset_id":209302,"created_at":"2020-04-29T00:26:44.681+08:00","updated_at":"2020-04-29T00:26:44.681+08:00"},{"id":2494149,"file_name":"b1.png","project_id":114766,"asset_id":209303,"created_at":"2020-04-29T00:26:44.683+08:00","updated_at":"2020-04-29T00:26:44.683+08:00"},{"id":2494152,"file_name":"b4.png","project_id":114766,"asset_id":209306,"created_at":"2020-04-29T00:26:45.500+08:00","updated_at":"2020-04-29T00:26:45.500+08:00"},{"id":2494153,"file_name":"b5.png","project_id":114766,"asset_id":209307,"created_at":"2020-04-29T00:26:45.501+08:00","updated_at":"2020-04-29T00:26:45.501+08:00"},{"id":2494265,"file_name":"p4.png","project_id":114766,"asset_id":209373,"created_at":"2020-04-29T10:30:43.306+08:00","updated_at":"2020-04-29T10:30:43.306+08:00"},{"id":2494266,"file_name":"p5.png","project_id":114766,"asset_id":209374,"created_at":"2020-04-29T10:30:43.308+08:00","updated_at":"2020-04-29T10:30:43.308+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦