{"id":105930,"student_id":3311,"content":"setBackdrop('black');\n\nvar ceiling = createSprite(\"ceiling.png\");\nceiling.x = 320;\nceiling.y = 8;\nceiling.layer = 1;\n\n\nvar player = createSprite([\"player_1.png\", \"player_2.png\", \"player_3.png\", \"player_4.png\"]);\nplayer.y = 50;\n\nvar hit;\nvar left_wall = createSprite(\"wall.png\");\nvar right_wall = createSprite(\"wall.png\");\nvar lastTime = 0;\nvar time = 0;\nvar touhOn;\nvar life = 10;\nvar floor = 0;\nvar vy = 0;\nvar stairs = [];\n\nleft_wall.x = 130;\nright_wall.x = 510;\n\nforever(function() {\n if (life \u003e 0 \u0026\u0026 player.y \u003c 480) {\n setBackdrop('black');\n flashBackGround();\n updatePlayer();\n updateStairs();\n checkTouchedCeiling();\n } else {\n setBackdrop('red');\n print('Game Over', 200, 200, 'white', 30);\n\n }\n\n print('分數:' + floor, 10, 10, 'white', 20);\n print('生命:' + life, 10, 40, 'while', 20);\n});\n\nfor (var i = 0; i \u003c 8; i++) {\n var stair = createSprite([\"conveyor_left.png\", \"conveyor_right.png\", \"normal.png\",\n \"fake.png\", \"trampoline.png\", \"nails.png\"]);\n stair.costumeId = Math.floor(Math.random()*6);\n stair.y = i*80 + 550;\n stair.x = Math.random()*250 +200;\n stairs.push(stair);\n}\n\nfunction updatePlayer() {\n if (key.right \u0026\u0026 !player.touched(right_wall)) {\n player.x += 3;\n }\n if (key.left \u0026\u0026 !player.touched(left_wall)) {\n player.x -= 3;\n \n // if (player.costumeId('player_5')) {\n // player.costumeId('player_4');\n // }\n }\n player.y += vy;\n vy += 0.1;\n}\nfunction updateStairs() {\n for (var i = 0; i \u003c stairs.length; i++) {\n stairs[i].y -= 2;\n if (stairs[i].y \u003c -10) {\n stairs[i].costumeId = Math.floor(Math.random()*6);\n stairs[i].y += 640;\n stairs[i].hidden = false;\n floor += 1;\n }\n }\n}\nfunction checkTouchedCeiling() {\n time = Date.now();\n if (player.touched(ceiling) \u0026\u0026 time - lastTime \u003e 3000) {\n life -= 3;\n vy = 0;\n lastTime = time;\n hit = true;\n }\n}\nfunction flashBackGround() {\n if (hit) {\n setBackdrop('red');\n hit = false;\n }\n}\nplayer.when(\"touch\", stairs, function(s) {\n vy = 0;\n player.y = s.y - 20;\n if (s.costumeId == 0) {\n player.x -= 2;\n }\n if (s.costumeId == 1) {\n player.x += 2;\n }\n if (s.costumeId == 4) {\n vy = -6;\n }\n if (s.costumeId == 2 \u0026\u0026 s !== touhOn) {\n life ++;\n }\n if (s.costumeId == 5 \u0026\u0026 s !== touhOn) {\n life -= 3;\n hit = true;\n }\n if (s.costumeId == 3) {\n setTimeout(function() {\n s.hidden = true;\n }, 300);\n }\n touhOn = s;\n});\n","created_at":"2019-11-09T13:38:16.281+08:00","updated_at":"2022-03-16T08:54:38.120+08:00","name":"小朋友下樓梯 副本","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/105930/37b54a47f6cc77d8b8c23ee203aee5af.jpg"},"parent_id":61784,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":174,"hashid":"meyszyvq","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1798818,"file_name":"conveyor_left.png","project_id":105930,"asset_id":114034,"created_at":"2019-11-09T13:38:16.291+08:00","updated_at":"2019-11-09T13:38:16.291+08:00"},{"id":1798819,"file_name":"conveyor_right.png","project_id":105930,"asset_id":114033,"created_at":"2019-11-09T13:38:16.293+08:00","updated_at":"2019-11-09T13:38:16.293+08:00"},{"id":1798820,"file_name":"fake.png","project_id":105930,"asset_id":114032,"created_at":"2019-11-09T13:38:16.295+08:00","updated_at":"2019-11-09T13:38:16.295+08:00"},{"id":1798821,"file_name":"normal.png","project_id":105930,"asset_id":114031,"created_at":"2019-11-09T13:38:16.296+08:00","updated_at":"2019-11-09T13:38:16.296+08:00"},{"id":1798822,"file_name":"trampoline.png","project_id":105930,"asset_id":114030,"created_at":"2019-11-09T13:38:16.298+08:00","updated_at":"2019-11-09T13:38:16.298+08:00"},{"id":1798823,"file_name":"nails.png","project_id":105930,"asset_id":114029,"created_at":"2019-11-09T13:38:16.299+08:00","updated_at":"2019-11-09T13:38:16.299+08:00"},{"id":1798824,"file_name":"ceiling.png","project_id":105930,"asset_id":114028,"created_at":"2019-11-09T13:38:16.300+08:00","updated_at":"2019-11-09T13:38:16.300+08:00"},{"id":1798825,"file_name":"wall.png","project_id":105930,"asset_id":114027,"created_at":"2019-11-09T13:38:16.302+08:00","updated_at":"2019-11-09T13:38:16.302+08:00"},{"id":1798826,"file_name":"player_3.png","project_id":105930,"asset_id":114026,"created_at":"2019-11-09T13:38:16.303+08:00","updated_at":"2019-11-09T13:38:16.303+08:00"},{"id":1798827,"file_name":"player_4.png","project_id":105930,"asset_id":114025,"created_at":"2019-11-09T13:38:16.304+08:00","updated_at":"2019-11-09T13:38:16.304+08:00"},{"id":1798828,"file_name":"player_2.png","project_id":105930,"asset_id":114024,"created_at":"2019-11-09T13:38:16.306+08:00","updated_at":"2019-11-09T13:38:16.306+08:00"},{"id":1798830,"file_name":"player_1.png","project_id":105930,"asset_id":114022,"created_at":"2019-11-09T13:38:16.314+08:00","updated_at":"2019-11-09T13:38:16.314+08:00"},{"id":1798831,"file_name":"bg.mp3","project_id":105930,"asset_id":114021,"created_at":"2019-11-09T13:38:16.316+08:00","updated_at":"2019-11-09T13:38:16.316+08:00"},{"id":1798832,"file_name":"flash.mp3","project_id":105930,"asset_id":114020,"created_at":"2019-11-09T13:38:16.318+08:00","updated_at":"2019-11-09T13:38:16.318+08:00"},{"id":1798833,"file_name":"gg.mp3","project_id":105930,"asset_id":114019,"created_at":"2019-11-09T13:38:16.319+08:00","updated_at":"2019-11-09T13:38:16.319+08:00"},{"id":1798834,"file_name":"jump.mp3","project_id":105930,"asset_id":114018,"created_at":"2019-11-09T13:38:16.321+08:00","updated_at":"2019-11-09T13:38:16.321+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦