{"id":164304,"student_id":3544,"content":"setBackdrop(\"#222222\");\nvar player = createSprite(\"player.png\"); // 建立玩家檔板\nvar ball = createSprite(\"ball.png\"); // 建立球\nvar score = 0;\nvar lives = 10000;\nvar speed = 5;\nvar level = 1;\nvar blocks = []\nplayer.y = 450;\nball.direction = 180;\ninitBlocks();\nforever(function () {\n if (lives \u003e 0) {\n player.x = cursor.x;\n updateball()\n } else\n \n print('game over', 170, 200, 'white', 60);\n\n\n\n\n\n\n\n\nupdateball()\nplayer.x = cursor.x\nprint(\"Score: \" + score, 20, 20, \"white\");\nprint(\"Lives: \" + lives, 20, 40, \"white\");\nprint(\"Level: \" + level, 20, 60, \"white\");\n});\nfunction initBlocks() {\nfor (var j = 0; j \u003c 3; j++) {\nfor (var i = 0; i \u003c 10; i++) {\nvar block = createSprite([\"b0.png\", \"b1.png\", \"b2.png\", \"b3.png\", \"b4.png\", \"b5.png\"])\nblock.costumeId = Math.floor(Math.random()*6);\nblock.x = 32+i*64;\nblock.y = 16+j*32\nblocks.push(block);\n}\n}\n}\nfunction updateball() {\nball.stepForward(speed);\nif (ball.x \u003c= 0 || ball.x \u003e 640) {\nball.direction=- ball.direction;\n}\nif (ball.y \u003c 0) {\nball.direction=- ball.direction+180;\n\n}\nif (ball.y \u003e= 480) {\nball.x = 320;\nball.y = 240;\nball.direction = 180;\nspeed = 5;\nlives--;\n}\n\n}\nball.on(\"touch\", player, function() {\nball.direction=-ball.direction+180\n+Math.random()*30-15;\n\n\n\nball.y = player.y-30;\n});\nball.on(\"touch\", blocks, function(block) {\nball.direction=- ball.direction+180\n+Math.random()*30-15;\nblock.destroy();\nscore++\nif (score%30 == 0) {\ninitBlocks();\nlevel++;\n}\nif (score%3 == 0 \u0026\u0026 speed \u003c 15) {\nspeed++;\n}\n\n\n\n\n\n})","created_at":"2020-07-11T13:37:33.456+08:00","updated_at":"2021-01-16T15:22:42.499+08:00","name":"breakout 副本","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/164304/cd6beb19b295c5eb1c71ef399fd43061.jpg"},"parent_id":60761,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":87,"hashid":"36ys8p2e","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2855683,"file_name":"b5.png","project_id":164304,"asset_id":113026,"created_at":"2020-07-11T13:37:33.463+08:00","updated_at":"2020-07-11T13:37:33.463+08:00"},{"id":2855685,"file_name":"b4.png","project_id":164304,"asset_id":113025,"created_at":"2020-07-11T13:37:33.464+08:00","updated_at":"2020-07-11T13:37:33.464+08:00"},{"id":2855686,"file_name":"b3.png","project_id":164304,"asset_id":113024,"created_at":"2020-07-11T13:37:33.466+08:00","updated_at":"2020-07-11T13:37:33.466+08:00"},{"id":2855688,"file_name":"b2.png","project_id":164304,"asset_id":113023,"created_at":"2020-07-11T13:37:33.467+08:00","updated_at":"2020-07-11T13:37:33.467+08:00"},{"id":2855689,"file_name":"b1.png","project_id":164304,"asset_id":113022,"created_at":"2020-07-11T13:37:33.468+08:00","updated_at":"2020-07-11T13:37:33.468+08:00"},{"id":2855690,"file_name":"b0.png","project_id":164304,"asset_id":113021,"created_at":"2020-07-11T13:37:33.470+08:00","updated_at":"2020-07-11T13:37:33.470+08:00"},{"id":2855692,"file_name":"ball.png","project_id":164304,"asset_id":113020,"created_at":"2020-07-11T13:37:33.471+08:00","updated_at":"2020-07-11T13:37:33.471+08:00"},{"id":2855693,"file_name":"player.png","project_id":164304,"asset_id":113019,"created_at":"2020-07-11T13:37:33.472+08:00","updated_at":"2020-07-11T13:37:33.472+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦