{"id":766781,"student_id":10,"content":"from game import *\nfrom random import *\n\nbg = create_sprite('bg.png')\nwall = create_sprite('wall.png')\na = create_sprite('l_0.png', 'l_1.png', 'l_2.png')\nb = create_sprite('c_0.png', 'c_1.png', 'c_2.png')\nc = create_sprite('r_0.png', 'r_1.png', 'r_2.png')\nplayer = create_sprite('p_0.png', 'p_3.png', 'p_4.png', 'p_1.png', 'p_2.png')\nrules = create_sprite('rules.png')\nwall.y = -900\nbg.y = 0\nplayer.x = 200\nplayer.y = 800\na.x = 200\nb.x = 600\nc.x = 1000\na.y = -random() * 1800 - 300\nb.y = -random() * 1800 - 300\nc.y = -random() * 1800 - 300\n\nratio = 0\nspeed = 1\nscore = 0\n\ndef loop():\n global speed, score\n if key.space: rules.hidden = True\n if rules.hidden: speed += 0.001\n if player.costume_id != 0:\n update_climber(a)\n update_climber(b)\n update_climber(c) \n update_wall()\n score += speed\n if bg.y \u003c 900: bg.y += 0.1\n draw_text(score // 100, 10, 10, 'white', 50)\n \ndef update_climber(s):\n s.y += speed\n if s.y \u003e 1000:\n s.y = -1600 - random() * 400\n s.costume_id = randrange(3)\n d = player.distance_to(s)\n if d \u003c 50: gameover()\n\ndef update_wall():\n wall.y += speed\n if wall.y \u003e 1800: wall.y -= 1800\n\ndef update_player():\n if player.costume_id == 1:\n player.y -= speed * 15 * ratio\n player.x += speed * 15\n if player.x \u003e= 1000:\n player.x = 1000\n player.costume_id = 2\n\n if player.costume_id == 3:\n player.y -= speed * 15 * ratio\n player.x -= speed * 15\n if player.x \u003c= 200:\n player.x = 200\n player.costume_id = 4\n \n if player.costume_id == 2 or player.costume_id == 4:\n player.y += speed * 1.5\n\n if player.y \u003e 1000: gameover()\n\ndef click():\n global ratio\n ratio = (player.y - cursor.y) / 800\n if player.costume_id == 0: player.costume_id = 1\n elif player.costume_id == 2: player.costume_id = 3\n elif player.costume_id == 4: player.costume_id = 1\n\ndef gameover():\n stop()\n\non('click', click)\nforever(loop)\n\n","created_at":"2024-06-12T12:33:42.806+08:00","updated_at":"2024-06-28T16:56:34.790+08:00","name":"飛簷走壁","language":"python","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/766781/174c33f7ec3506408272cc77f5013142.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":64,"hashid":"p93srp28w","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17321522,"file_name":"p_1.png","project_id":766781,"asset_id":750903,"created_at":"2024-06-28T12:19:10.685+08:00","updated_at":"2024-06-28T12:19:10.685+08:00"},{"id":17321523,"file_name":"p_2.png","project_id":766781,"asset_id":750904,"created_at":"2024-06-28T12:19:10.687+08:00","updated_at":"2024-06-28T12:19:10.687+08:00"},{"id":17321524,"file_name":"p_3.png","project_id":766781,"asset_id":750905,"created_at":"2024-06-28T12:19:11.139+08:00","updated_at":"2024-06-28T12:19:11.139+08:00"},{"id":17321525,"file_name":"p_4.png","project_id":766781,"asset_id":750906,"created_at":"2024-06-28T12:19:11.140+08:00","updated_at":"2024-06-28T12:19:11.140+08:00"},{"id":17321528,"file_name":"r_2.png","project_id":766781,"asset_id":750909,"created_at":"2024-06-28T12:19:12.715+08:00","updated_at":"2024-06-28T12:19:12.715+08:00"},{"id":17321529,"file_name":"rules.png","project_id":766781,"asset_id":750910,"created_at":"2024-06-28T12:19:12.717+08:00","updated_at":"2024-06-28T12:19:12.717+08:00"},{"id":17321518,"file_name":"l_0.png","project_id":766781,"asset_id":750899,"created_at":"2024-06-28T12:19:09.629+08:00","updated_at":"2024-06-28T12:19:09.629+08:00"},{"id":17321519,"file_name":"l_1.png","project_id":766781,"asset_id":750900,"created_at":"2024-06-28T12:19:09.631+08:00","updated_at":"2024-06-28T12:19:09.631+08:00"},{"id":17321526,"file_name":"r_0.png","project_id":766781,"asset_id":750907,"created_at":"2024-06-28T12:19:11.695+08:00","updated_at":"2024-06-28T12:19:11.695+08:00"},{"id":17321527,"file_name":"r_1.png","project_id":766781,"asset_id":750908,"created_at":"2024-06-28T12:19:11.697+08:00","updated_at":"2024-06-28T12:19:11.697+08:00"},{"id":17321514,"file_name":"bg.png","project_id":766781,"asset_id":750895,"created_at":"2024-06-28T12:19:08.464+08:00","updated_at":"2024-06-28T12:19:08.464+08:00"},{"id":17321515,"file_name":"c_0.png","project_id":766781,"asset_id":750896,"created_at":"2024-06-28T12:19:08.467+08:00","updated_at":"2024-06-28T12:19:08.467+08:00"},{"id":17321520,"file_name":"l_2.png","project_id":766781,"asset_id":750901,"created_at":"2024-06-28T12:19:10.094+08:00","updated_at":"2024-06-28T12:19:10.094+08:00"},{"id":17321521,"file_name":"p_0.png","project_id":766781,"asset_id":750902,"created_at":"2024-06-28T12:19:10.096+08:00","updated_at":"2024-06-28T12:19:10.096+08:00"},{"id":17321516,"file_name":"c_1.png","project_id":766781,"asset_id":750897,"created_at":"2024-06-28T12:19:08.998+08:00","updated_at":"2024-06-28T12:19:08.998+08:00"},{"id":17321517,"file_name":"c_2.png","project_id":766781,"asset_id":750898,"created_at":"2024-06-28T12:19:08.999+08:00","updated_at":"2024-06-28T12:19:08.999+08:00"},{"id":17321530,"file_name":"wall.png","project_id":766781,"asset_id":750911,"created_at":"2024-06-28T12:19:13.492+08:00","updated_at":"2024-06-28T12:19:13.492+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦