{"id":87146,"student_id":3647,"content":"setBackdrop(\"#222222\");\nvar player = createSprite(\"player.png\"); // 建立玩家檔板\nvar ball = createSprite(\"ball.png\"); // 建立球\nvar score = 0;\nvar lives = 5;\nvar speed = 5;\nvar level = 1;\nvar block = createSprite([\"b0.png\", \"b1.png\", \"b2.png\", \"b3.png\", \"b4.png\", \"b5.png\"]);\nvar blocksss = [];\nblocks();\n\nplayer.y = 450;\nball.direction = 180;\n\n\n if (lives\u003e0) {\n upball();\n player.x=cursor.x; \n }else {\n print ('game over', 320, 200, 'white', 60); \n \n \n \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});\n \n\n\n\nfunction blocks() {\nfor (var j = 0; j \u003c 5; 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 = 32+i*64;\n block.y = 16+j*32;\n console.log(j);\n console.log(i);\n }\n}\n\n}\nfunction upball() {\n ball.stepForward(speed);\n ball.on('touch', player, function(){\n \n ball.direction = -ball.direction+200;\n \n });\n ball.on('touch', blocksss, function(block){\n \n ball.direction = -ball.direction+180+Math.random()*30-15;\n });\n block.destroy();\n score+1;\n if (score%30===0) {\n blocks();\n level+1;\n }\n }\n if (score%3===0\u0026\u0026speed\u003c20) {\n speed++; \n }\n \n if (ball.x \u003e= 640 || ball.x \u003c= 0) {\n ball.direction = -ball.direction;\n \n\n }\n if (ball.y \u003c= 0) {\n ball.direction = -ball.direction+180+Math.random()*30-15;\n \n\n }\n if (ball.y \u003e= 480) {\n lives-=1;\n ball.x=320;\n ball.y=240;\n ball.direction=180;\n speed=5;}\n \n \n \n\n\n\n","created_at":"2019-08-03T18:37:11.768+08:00","updated_at":"2019-08-03T20:04:29.972+08:00","name":"breakout 副本","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/87146/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":60761,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":114,"hashid":"jzmsdw35","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1476969,"file_name":"b5.png","project_id":87146,"asset_id":113026,"created_at":"2019-08-03T18:37:11.772+08:00","updated_at":"2019-08-03T18:37:11.772+08:00"},{"id":1476970,"file_name":"b4.png","project_id":87146,"asset_id":113025,"created_at":"2019-08-03T18:37:11.773+08:00","updated_at":"2019-08-03T18:37:11.773+08:00"},{"id":1476971,"file_name":"b3.png","project_id":87146,"asset_id":113024,"created_at":"2019-08-03T18:37:11.774+08:00","updated_at":"2019-08-03T18:37:11.774+08:00"},{"id":1476972,"file_name":"b2.png","project_id":87146,"asset_id":113023,"created_at":"2019-08-03T18:37:11.775+08:00","updated_at":"2019-08-03T18:37:11.775+08:00"},{"id":1476973,"file_name":"b1.png","project_id":87146,"asset_id":113022,"created_at":"2019-08-03T18:37:11.776+08:00","updated_at":"2019-08-03T18:37:11.776+08:00"},{"id":1476974,"file_name":"b0.png","project_id":87146,"asset_id":113021,"created_at":"2019-08-03T18:37:11.777+08:00","updated_at":"2019-08-03T18:37:11.777+08:00"},{"id":1476975,"file_name":"ball.png","project_id":87146,"asset_id":113020,"created_at":"2019-08-03T18:37:11.777+08:00","updated_at":"2019-08-03T18:37:11.777+08:00"},{"id":1476976,"file_name":"player.png","project_id":87146,"asset_id":113019,"created_at":"2019-08-03T18:37:11.778+08:00","updated_at":"2019-08-03T18:37:11.778+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦