{"id":326660,"student_id":10,"content":"createSprite('cover.png');\nlet player = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png', '10.png');\nlet gem = createSprite('gem_0.png', 'gem_1.png', 'gem_2.png', 'bomb.png');\nlet number = createSprite('n_1.png', 'n_2.png', 'n_3.png', 'n_4.png', 'n_5.png');\nlet info = createSprite('info.png', 'next.png', 'gameover.png');\nlet sight = createSprite('target.png');\n\nlet blocks = [];\nlet level = 1;\nlet timer = 0;\nlet target;\nlet vy = 0;\nlet count = 0;\nlet score = 0;\nlet clock = 0;\n\nfor (let y = 0; y \u003c 6; y++) {\n for (let x = 0; x \u003c 10; x++) {\n let b = createSprite('b_1.png', 'b_4.png', 'b_2.png', 'b_5.png', 'b_0.png', 'b_0.png', 'b_0.png', 'b_0.png');\n b.x = x * 100 + 150;\n b.y = y * 100 + 150;\n if (x % 2 == 0) b.y -= 50;\n b.on('click', function () {\n if (b.costumeId \u003e 3) target = b;\n })\n b.layer = -1;\n blocks.push(b);\n }\n}\n\nplayer.rotationStyle = 'fixed';\nnumber.opacity = 0.5;\n\nfunction reset () {\n level += 1;\n count = 0;\n timer = 1500;\n player.moveTo(600, 450);\n for (let i = 0; i \u003c 60; i++) {\n if (i \u003c 15) blocks[i].costumeId = 1;\n else if (i \u003c 17) blocks[i].costumeId = 3;\n else if (i \u003c 17 + level) blocks[i].costumeId = 2;\n else blocks[i].costumeId = 0;\n }\n shuffle();\n}\n\nfunction shuffle () {\n for (let i = 0; i \u003c 60; i++) {\n let randA = Math.floor(Math.random() * 60);\n let randB = Math.floor(Math.random() * 60);\n let a = blocks[randA].costumeId;\n let b = blocks[randB].costumeId;\n blocks[randA].costumeId = b;\n blocks[randB].costumeId = a;\n }\n}\n\nfunction gameloop () {\n sight.moveTo(cursor);\n if (info.hidden) {\n updateTimer();\n updatePlayer();\n updateGem();\n updateTexts();\n clock -= 1;\n }\n}\n\n\nfunction updatePlayer () {\n if (target) {\n if (player.distanceTo(target) \u003e 6) {\n player.toward(target);\n player.stepForward(6);\n player.costumeId = Math.floor(player.direction / 90) * 2;\n if (timer % 12 \u003e 6) player.costumeId += 1;\n } else {\n if (target.costumeId == 5) {\n gem.costumeId = 0;\n gem.moveTo(player);\n vy = -15;\n score += 1;\n }\n if (target.costumeId == 6) {\n gem.costumeId = 2;\n gem.moveTo(player);\n vy = -15;\n count += 1;\n }\n if (target.costumeId == 7) {\n timer = 0;\n player.costumeId = 10;\n }\n target.costumeId -= 4;\n target = undefined;\n clock = 20;\n }\n }\n\n if (clock \u003e 10) player.costumeId = 8;\n else if (clock \u003e 0) player.costumeId = 9;\n}\n\nfunction updateTimer () {\n timer -= 1;\n if (timer == 1200) hideAll();\n if (timer == 0) timeout();\n number.costumeId = Math.floor(timer / 60) % 5;\n number.hidden = timer \u003e= 300 \u0026\u0026 timer \u003c= 1200;\n}\n\nfunction hideAll () {\n for (let i = 0; i \u003c 60; i++) {\n blocks[i].costumeId += 4;\n }\n}\n\nfunction timeout () {\n info.hidden = false;\n info.costumeId = count == level ? 1: 2;\n}\n\nfunction updateGem() {\n vy += 0.5;\n gem.y += vy;\n gem.direction += 10;\n}\n\nfunction updateTexts() {\n drawText(Math.round(timer / 60), 250, 830, 'white', 50);\n drawText(score, 650, 830, 'white', 50);\n drawText(count, 1050, 830, 'white', 50);\n}\n\nfunction infoOnClick () {\n info.hidden = true;\n if (info.costumeId == 2) {\n let result = createSprite('end_0.png', 'end_1.png', 'end_2.png', 'end_3.png', 'end_4.png', 'end_5.png');\n result.costumeId += Math.floor(score / 5);\n if (reset.costumeId \u003e 5) reset.costumeId = 5;\n info.hidden = true;\n stop();\n } else {\n reset();\n }\n}\n\nforever(gameloop);\ninfo.on('click', infoOnClick);\n","created_at":"2021-12-17T23:04:55.667+08:00","updated_at":"2021-12-21T17:11:28.333+08:00","name":"企鵝挖寶石","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/326660/b230fa3bcc0fafe3f75ee57f07ce202f.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":178,"hashid":"882sqkere","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":6944762,"file_name":"b_0.png","project_id":326660,"asset_id":451275,"created_at":"2021-12-21T13:40:13.195+08:00","updated_at":"2021-12-21T13:40:13.195+08:00"},{"id":6944763,"file_name":"b_1.png","project_id":326660,"asset_id":453610,"created_at":"2021-12-21T13:40:13.197+08:00","updated_at":"2021-12-21T13:40:13.197+08:00"},{"id":6944764,"file_name":"b_2.png","project_id":326660,"asset_id":453611,"created_at":"2021-12-21T13:40:13.773+08:00","updated_at":"2021-12-21T13:40:13.773+08:00"},{"id":6944765,"file_name":"b_3.png","project_id":326660,"asset_id":453612,"created_at":"2021-12-21T13:40:13.774+08:00","updated_at":"2021-12-21T13:40:13.774+08:00"},{"id":6944766,"file_name":"b_4.png","project_id":326660,"asset_id":453613,"created_at":"2021-12-21T13:40:14.385+08:00","updated_at":"2021-12-21T13:40:14.385+08:00"},{"id":6944767,"file_name":"b_5.png","project_id":326660,"asset_id":453614,"created_at":"2021-12-21T13:40:14.386+08:00","updated_at":"2021-12-21T13:40:14.386+08:00"},{"id":6944768,"file_name":"board.png","project_id":326660,"asset_id":453615,"created_at":"2021-12-21T13:40:14.943+08:00","updated_at":"2021-12-21T13:40:14.943+08:00"},{"id":6944769,"file_name":"bomb.png","project_id":326660,"asset_id":453616,"created_at":"2021-12-21T13:40:14.944+08:00","updated_at":"2021-12-21T13:40:14.944+08:00"},{"id":6944771,"file_name":"end_0.png","project_id":326660,"asset_id":453618,"created_at":"2021-12-21T13:40:16.446+08:00","updated_at":"2021-12-21T13:40:16.446+08:00"},{"id":6944772,"file_name":"end_1.png","project_id":326660,"asset_id":453619,"created_at":"2021-12-21T13:40:17.351+08:00","updated_at":"2021-12-21T13:40:17.351+08:00"},{"id":6944773,"file_name":"end_2.png","project_id":326660,"asset_id":453620,"created_at":"2021-12-21T13:40:17.352+08:00","updated_at":"2021-12-21T13:40:17.352+08:00"},{"id":6944774,"file_name":"end_3.png","project_id":326660,"asset_id":453621,"created_at":"2021-12-21T13:40:18.307+08:00","updated_at":"2021-12-21T13:40:18.307+08:00"},{"id":6944775,"file_name":"end_4.png","project_id":326660,"asset_id":453622,"created_at":"2021-12-21T13:40:18.308+08:00","updated_at":"2021-12-21T13:40:18.308+08:00"},{"id":6944776,"file_name":"end_5.png","project_id":326660,"asset_id":453623,"created_at":"2021-12-21T13:40:19.293+08:00","updated_at":"2021-12-21T13:40:19.293+08:00"},{"id":6944777,"file_name":"end.png","project_id":326660,"asset_id":453624,"created_at":"2021-12-21T13:40:19.294+08:00","updated_at":"2021-12-21T13:40:19.294+08:00"},{"id":6944778,"file_name":"gem_0.png","project_id":326660,"asset_id":453625,"created_at":"2021-12-21T13:40:19.788+08:00","updated_at":"2021-12-21T13:40:19.788+08:00"},{"id":6944779,"file_name":"gem_1.png","project_id":326660,"asset_id":453626,"created_at":"2021-12-21T13:40:19.790+08:00","updated_at":"2021-12-21T13:40:19.790+08:00"},{"id":6944780,"file_name":"gem_2.png","project_id":326660,"asset_id":453627,"created_at":"2021-12-21T13:40:20.546+08:00","updated_at":"2021-12-21T13:40:20.546+08:00"},{"id":6944781,"file_name":"info.png","project_id":326660,"asset_id":453628,"created_at":"2021-12-21T13:40:20.548+08:00","updated_at":"2021-12-21T13:40:20.548+08:00"},{"id":6944782,"file_name":"n_1.png","project_id":326660,"asset_id":453629,"created_at":"2021-12-21T13:40:21.086+08:00","updated_at":"2021-12-21T13:40:21.086+08:00"},{"id":6944783,"file_name":"n_2.png","project_id":326660,"asset_id":453630,"created_at":"2021-12-21T13:40:21.088+08:00","updated_at":"2021-12-21T13:40:21.088+08:00"},{"id":6944784,"file_name":"n_3.png","project_id":326660,"asset_id":453631,"created_at":"2021-12-21T13:40:21.611+08:00","updated_at":"2021-12-21T13:40:21.611+08:00"},{"id":6944785,"file_name":"n_4.png","project_id":326660,"asset_id":453632,"created_at":"2021-12-21T13:40:21.613+08:00","updated_at":"2021-12-21T13:40:21.613+08:00"},{"id":6944786,"file_name":"n_5.png","project_id":326660,"asset_id":453633,"created_at":"2021-12-21T13:40:22.397+08:00","updated_at":"2021-12-21T13:40:22.397+08:00"},{"id":6944787,"file_name":"next.png","project_id":326660,"asset_id":453634,"created_at":"2021-12-21T13:40:22.399+08:00","updated_at":"2021-12-21T13:40:22.399+08:00"},{"id":6944802,"file_name":"target.png","project_id":326660,"asset_id":453649,"created_at":"2021-12-21T13:40:26.971+08:00","updated_at":"2021-12-21T13:40:26.971+08:00"},{"id":6944803,"file_name":"gameover.png","project_id":326660,"asset_id":451290,"created_at":"2021-12-21T13:40:26.973+08:00","updated_at":"2021-12-21T13:40:26.973+08:00"},{"id":6944804,"file_name":"timeout.png","project_id":326660,"asset_id":451290,"created_at":"2021-12-21T13:40:27.716+08:00","updated_at":"2021-12-21T13:40:27.716+08:00"},{"id":6944886,"file_name":"6.png","project_id":326660,"asset_id":453651,"created_at":"2021-12-21T16:16:35.779+08:00","updated_at":"2021-12-21T16:16:35.779+08:00"},{"id":6944887,"file_name":"7.png","project_id":326660,"asset_id":453652,"created_at":"2021-12-21T16:16:35.780+08:00","updated_at":"2021-12-21T16:16:35.780+08:00"},{"id":6944890,"file_name":"0.png","project_id":326660,"asset_id":453638,"created_at":"2021-12-21T16:16:36.879+08:00","updated_at":"2021-12-21T16:16:36.879+08:00"},{"id":6944891,"file_name":"1.png","project_id":326660,"asset_id":453639,"created_at":"2021-12-21T16:16:36.881+08:00","updated_at":"2021-12-21T16:16:36.881+08:00"},{"id":6944894,"file_name":"8.png","project_id":326660,"asset_id":453646,"created_at":"2021-12-21T16:16:38.020+08:00","updated_at":"2021-12-21T16:16:38.020+08:00"},{"id":6944895,"file_name":"9.png","project_id":326660,"asset_id":453647,"created_at":"2021-12-21T16:16:38.022+08:00","updated_at":"2021-12-21T16:16:38.022+08:00"},{"id":6944888,"file_name":"4.png","project_id":326660,"asset_id":453653,"created_at":"2021-12-21T16:16:36.354+08:00","updated_at":"2021-12-21T16:16:36.354+08:00"},{"id":6944889,"file_name":"5.png","project_id":326660,"asset_id":453654,"created_at":"2021-12-21T16:16:36.356+08:00","updated_at":"2021-12-21T16:16:36.356+08:00"},{"id":6944892,"file_name":"2.png","project_id":326660,"asset_id":453640,"created_at":"2021-12-21T16:16:37.456+08:00","updated_at":"2021-12-21T16:16:37.456+08:00"},{"id":6944893,"file_name":"3.png","project_id":326660,"asset_id":453641,"created_at":"2021-12-21T16:16:37.458+08:00","updated_at":"2021-12-21T16:16:37.458+08:00"},{"id":6944896,"file_name":"10.png","project_id":326660,"asset_id":453648,"created_at":"2021-12-21T16:16:38.572+08:00","updated_at":"2021-12-21T16:16:38.572+08:00"},{"id":6944897,"file_name":"cover.png","project_id":326660,"asset_id":453655,"created_at":"2021-12-21T16:20:20.705+08:00","updated_at":"2021-12-21T16:20:20.705+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦