{"id":7811,"student_id":137,"content":"setBackdrop(\"#0072E3\");\nvar score = 0;\nvar speed = 1;\nvar net = createSprite(\"net.png\");\nnet.scale = 0.2;\nnet.x = 50;\nnet.y = 400;\nnet.hp = 100\n\nfor(var i=0;i\u003c8;i++){\ncreatfish();\n}\n\n\nfunction creatfish(){\nvar fish = createSprite(\"fish.png\");\nfish.x = Math.random()*620;\nfish.y = Math.random()*440;\nfish.scale = 0.1\nfish.direction = Math.random()*360;\n\nfish.forever(function(){\nif(fish.x \u003e 600){\nfish.direction = Math.random()*180+180;\n}\nif(fish.x \u003c 40){\nfish.direction = Math.random()*180;\n}\nif(fish.y \u003e 420){\nfish.direction = Math.random()*180+270;\n}\nif(fish.y \u003c 40){\nfish.direction = Math.random()*180+90;\n}\nfish.stepForward(speed);\n});\n\nfish.when(\"click\",function(){\nspeed = speed + 0.2;\nscore = score + 10;\nnet.hp = net.hp + 10;\nfish.destroy();\ncreatfish();\n});\n}\n\nnet.forever(function(){\nnet.x = cursor.x;\nnet.y = cursor.y;\nprint(\"score:\"+score,20,20,\"yellow\");\nprint(\"hp:\"+net.hp,20,40,\"yellow\");\nif(net.hp \u003c=0){\nprint(\"score:\"+score,160,150,\"red\",100);\n alert('遊戲結束,獲得 ' + score + ' 分!');\nstop();\n}\n});\n\nnet.when(\"click\",function(){\nnet.hp = net.hp-10\n});","created_at":"2017-07-04T18:17:55.947+08:00","updated_at":"2019-10-27T11:44:27.739+08:00","name":"撈金魚","language":"javascript","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/7811/994354d8792a71f1c45c30510c953813.jpg"},"parent_id":7781,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":523,"hashid":"npmsjvm","is_content_changed":null,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":174116,"file_name":"net.png","project_id":7811,"asset_id":21099,"created_at":"2017-07-05T18:36:51.513+08:00","updated_at":"2017-07-05T18:36:51.513+08:00"},{"id":174117,"file_name":"fish.png","project_id":7811,"asset_id":21100,"created_at":"2017-07-05T18:36:51.518+08:00","updated_at":"2017-07-05T18:36:51.518+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦