{"id":206736,"student_id":12205,"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//var collider = [player];\nvar blocks = [player];\nvar speed = 5;\nball.direction = 80;\nsound.play('x.mp3');\n\nplayer.y = 450;\nball.direction = 180;\ninitBlocks();\nforever(function () {\n player.x = cursor.x;\n // player.y = cursor.y;\n\n updateball();\n print(\"Score: \" + score, 20, 20, \"white\");\n print(\"Lives: \" + lives, 20, 40, \"white\");\n print(\"Level: \" + level, 20, 60, \"white\");\n if (lives \u003c 1) {\n print(\"GAME OVER\", 40, 100, \"white\");\n stop();\n }\n});\n//http://w1.loxa.com.tw/s846318/index3-5.htm\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction updateball() {\n\n ball.stepForward(speed);\n if (ball.x \u003c= 0 || ball.x \u003e= 640) {\n ball.direction =-ball.direction;\n }\n if (ball.y \u003c= 0) {\n ball.direction =-ball.direction+180;\n }\n if (ball.y \u003e= 480) {\n ball.x = 320;\n ball.y = 240;\n ball.direction = 180;\n speed = 5;\n lives --;\n }\n}\n\nball.on(\"touch\", player, function() {\n ball.direction=-ball.direction+180+Math.random()*30-15;\n ball.y = player.y-30;\n});\nball.on(\"touch\", blocks, function(block) {\n ball.direction=-ball.direction+180+Math.random()*30-15;\n speed+= 0.1;\n block.destroy();\n score++;\n if (score %30 == 0) {\n initBlocks();\n level++;\n speed=5;\n\n }\n});\n//https://appsgeyser.io/12701050/cho%20waysearch*/","created_at":"2020-11-25T19:11:06.295+08:00","updated_at":"2021-01-18T20:11:56.441+08:00","name":"breakout 副本","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/206736/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":60761,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":70,"hashid":"p93skkz2y","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3590849,"file_name":"b5.png","project_id":206736,"asset_id":113026,"created_at":"2020-11-25T19:11:06.300+08:00","updated_at":"2020-11-25T19:11:06.300+08:00"},{"id":3590850,"file_name":"b4.png","project_id":206736,"asset_id":113025,"created_at":"2020-11-25T19:11:06.301+08:00","updated_at":"2020-11-25T19:11:06.301+08:00"},{"id":3590851,"file_name":"b3.png","project_id":206736,"asset_id":113024,"created_at":"2020-11-25T19:11:06.302+08:00","updated_at":"2020-11-25T19:11:06.302+08:00"},{"id":3590852,"file_name":"b2.png","project_id":206736,"asset_id":113023,"created_at":"2020-11-25T19:11:06.304+08:00","updated_at":"2020-11-25T19:11:06.304+08:00"},{"id":3590853,"file_name":"b1.png","project_id":206736,"asset_id":113022,"created_at":"2020-11-25T19:11:06.305+08:00","updated_at":"2020-11-25T19:11:06.305+08:00"},{"id":3590854,"file_name":"b0.png","project_id":206736,"asset_id":113021,"created_at":"2020-11-25T19:11:06.306+08:00","updated_at":"2020-11-25T19:11:06.306+08:00"},{"id":3590855,"file_name":"ball.png","project_id":206736,"asset_id":113020,"created_at":"2020-11-25T19:11:06.307+08:00","updated_at":"2020-11-25T19:11:06.307+08:00"},{"id":3590856,"file_name":"player.png","project_id":206736,"asset_id":113019,"created_at":"2020-11-25T19:11:06.308+08:00","updated_at":"2020-11-25T19:11:06.308+08:00"},{"id":3591224,"file_name":"x.mp3","project_id":206736,"asset_id":284979,"created_at":"2020-11-25T20:53:22.260+08:00","updated_at":"2020-11-28T13:59:28.135+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦