{"id":226841,"student_id":10,"content":"Game.set({width: 800, height: 1200})\n\nvar player = createSprite('player.png');\nvar vx = 0;\nvar vy = 0;\nvar pps = [];\nvar circles = [];\nvar score = 0;\nplayer.y = 900;\n\nfor (var i=0; i\u003c10; i++) {\n var s = createSprite('pp.png', 'orange.png', 'apple.png');\n s.costumeId = Math.floor(Math.random() * 3);\n s.x = Math.random() * 600 + 100;\n s.y = - i * 300;\n pps.push(s);\n}\n\nfor (var i=0; i\u003c10; i++) {\n var c = createSprite('circle.png');\n c.x = player.x;\n c.y = player.y + i * 30;\n circles.push(c);\n}\n\nfunction gameloop () {\n score += 1;\n player.x += vx;\n \n if (player.x \u003e 800 || player.x \u003c 0) {\n vx = -vx;\n }\n \n for (var i=0; i\u003cpps.length; i++) {\n var s = pps[i];\n s.y += vy;\n if (s.y \u003e 1200) {\n s.y -= 3000 - Math.random() * 100;\n s.x = Math.random() * 600 + 100;\n s.hidden = false;\n if (Math.random() \u003e 0.9) {\n s.costumeId = 1;\n } else {\n s.costumeId = 0;\n }\n }\n \n if (s.touched(player)) {\n if (s.costumeId == 0) {\n s.scale = 2;\n stop();\n } else {\n s.hidden = true;\n }\n }\n }\n \n for (var i=0; i\u003ccircles.length; i++) {\n var c = circles[i];\n c.y += vy;\n c.scale -= 0.01;\n c.opacity -= 0.01;\n if (c.y \u003e 1200) {\n c.x = player.x;\n c.y = player.y;\n c.scale = 1;\n c.opacity = 1;\n }\n }\n \n print(score);\n}\n\nfunction changeDirection() {\n if (vx == 0) {\n vx = 5;\n vy = 5;\n } else {\n vx = -vx;\n }\n}\n\nforever(gameloop);\non('click', changeDirection);","created_at":"2021-02-04T16:15:32.551+08:00","updated_at":"2021-03-17T16:35:37.448+08:00","name":"poopy river","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/226841/bdbacac214027916cbbc2e35afdf86a1.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":199,"hashid":"d5msvn8gm","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4039847,"file_name":"pp.png","project_id":226841,"asset_id":314603,"created_at":"2021-02-04T16:16:03.281+08:00","updated_at":"2021-02-04T16:16:03.281+08:00"},{"id":4039848,"file_name":"player.png","project_id":226841,"asset_id":314604,"created_at":"2021-02-04T16:16:03.282+08:00","updated_at":"2021-02-04T16:16:03.282+08:00"},{"id":4039849,"file_name":"orange.png","project_id":226841,"asset_id":314605,"created_at":"2021-02-04T16:16:03.821+08:00","updated_at":"2021-02-04T16:16:03.821+08:00"},{"id":4039850,"file_name":"apple.png","project_id":226841,"asset_id":314606,"created_at":"2021-02-04T16:16:03.822+08:00","updated_at":"2021-02-04T16:16:03.822+08:00"},{"id":4096256,"file_name":"circle.png","project_id":226841,"asset_id":318346,"created_at":"2021-02-17T18:38:20.896+08:00","updated_at":"2021-02-17T18:38:20.896+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦