{"id":13419,"student_id":10,"content":"var score = 0;\nvar lives = 3;\nvar stageblocks = 0;\n\nvar player = createSprite(\"player.png\");\nplayer.y = 450 + player.height/2;\n\nvar collider = [player];\n\nvar ball = createSprite(\"ball.png\");\nball.direction = 135;\n\nsetBackdrop(\"#333333\");\n\nfunction newBlocks(){\n for(var j = 0; j \u003c 6; j++){\n for(var i = 0; i \u003c 10; i++){\n var block = createSprite([\"block0.png\", \"block1.png\", \"block2.png\", \"block3.png\", \"block4.png\", \"block5.png\"]);\n block.costumeId = Math.floor(Math.random()*6);\n block.x = i*64+32;\n block.y = j*32+16;\n collider.push(block);\n stageblocks++;\n }\n }\n}\n\nforever(function(){\n\n player.x = cursor.x;\n\n ball.stepForward(4);\n \n if(lives \u003c= 0){\n stop();\n }\n if(ball.y \u003e= 480){\n lives--;\n ball.y = 300;\n }else{\n ball.bounceEdge();\n }\n if(stageblocks \u003c= 0){\n newBlocks();\n }\n print(\"Score: \"+score, 20, 20, \"white\");\n print(\"Lives: \"+lives, 20, 40, \"white\");\n});\n\nball.when('touch', collider, function (block) {\n ball.direction = -ball.direction + 180;\n if (block != player) {\n score++;\n block.destroy();\n stageblocks--;\n } else {\n ball.y = (player.y - player.height/2) - ball.height/2;\n }\n});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-08T00:49:09.162+08:00","name":"breakout ","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/13419/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":9310,"plugin":"","description":"","note":null,"status":"public","like_student_ids":[1934,1910,1937],"is_featured":false,"views":617,"hashid":"2pds9ww2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":276000,"file_name":"player.png","project_id":13419,"asset_id":33507,"created_at":"2017-10-20T11:25:43.050+08:00","updated_at":"2017-10-20T11:25:43.050+08:00"},{"id":276001,"file_name":"ball.png","project_id":13419,"asset_id":33508,"created_at":"2017-10-20T11:25:43.052+08:00","updated_at":"2017-10-20T11:25:43.052+08:00"},{"id":276002,"file_name":"block1.png","project_id":13419,"asset_id":33509,"created_at":"2017-10-20T11:28:02.178+08:00","updated_at":"2017-10-20T11:28:02.178+08:00"},{"id":276003,"file_name":"block2.png","project_id":13419,"asset_id":33510,"created_at":"2017-10-20T11:28:02.181+08:00","updated_at":"2017-10-20T11:28:02.181+08:00"},{"id":276004,"file_name":"block0.png","project_id":13419,"asset_id":33511,"created_at":"2017-10-20T11:28:02.427+08:00","updated_at":"2017-10-20T11:28:02.427+08:00"},{"id":276005,"file_name":"block4.png","project_id":13419,"asset_id":33512,"created_at":"2017-10-20T11:28:02.430+08:00","updated_at":"2017-10-20T11:28:02.430+08:00"},{"id":276006,"file_name":"block5.png","project_id":13419,"asset_id":33513,"created_at":"2017-10-20T11:28:02.683+08:00","updated_at":"2017-10-20T11:28:02.683+08:00"},{"id":276007,"file_name":"block3.png","project_id":13419,"asset_id":33514,"created_at":"2017-10-20T11:28:02.685+08:00","updated_at":"2017-10-20T11:28:02.685+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦