{"id":455043,"student_id":10,"content":"import game #載入遊戲套件\n\ngame.set_backdrop('bg_0.png') #設定起始背景\nplayer = game.create_sprite('p_0.png', 'p_1.png', 'p_2.png', 'p_3.png') #可愛的叩叮們\nplayer.y = 700\n\nclock = 0 #紀錄遊戲迴圈次數\n\ngame.create_sound('bgm.mp3', True)\n\n#遊戲主迴圈\ndef loop():\n global clock\n \n clock += 1\n game.draw_text(clock)\n \n if clock == 180: #遊戲開始「大約」3 秒鐘的時間開始\n player.costume_id = 1\n game.set_backdrop('bg_1.png')\n game.create_sound('shot.mp3')\n \n if player.x \u003c= 550:\n player.costume_id = 2\n game.set_backdrop('bg_2.png')\n \n if player.x \u003e= 650:\n player.costume_id = 3\n game.set_backdrop('bg_3.png')\n\n#向左移動\ndef pull_left():\n if player.costume_id == 1:\n player.x = player.x - 10\n\n#向右移動\ndef pull_right():\n if player.costume_id == 1:\n player.x = player.x + 10\n\n#重新開始\ndef restart():\n global clock\n clock = 0\n player.x = 600\n player.costume_id = 0\n game.set_backdrop(\"bg_0.png\")\n\ngame.forever(loop) #重複不斷執行遊戲迴圈\ngame.on('keyup', 'enter', pull_right) #按下放開 enter 鍵時執行 pull_right\ngame.on('keyup', 'space', pull_left) #按下放開 空白按鍵時執行 pull_left\ngame.on('keyup', 'r', restart) #按下放開 r 按鍵時執行 restart\n\n\n","created_at":"2022-11-02T15:39:48.272+08:00","updated_at":"2022-11-02T15:40:02.956+08:00","name":"運動會系列 - 拔河競賽(完整版) 副本","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/455043/9deb3fd8f20a91703e3a103a50c067a7.jpg"},"parent_id":366863,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":137,"hashid":"ej9s9w94m","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":10313446,"file_name":"bgm.mp3","project_id":455043,"asset_id":494544,"created_at":"2022-11-02T15:39:48.279+08:00","updated_at":"2022-11-02T15:39:48.279+08:00"},{"id":10313447,"file_name":"bg_0.png","project_id":455043,"asset_id":494545,"created_at":"2022-11-02T15:39:48.282+08:00","updated_at":"2022-11-02T15:39:48.282+08:00"},{"id":10313448,"file_name":"p_3.png","project_id":455043,"asset_id":494546,"created_at":"2022-11-02T15:39:48.283+08:00","updated_at":"2022-11-02T15:39:48.283+08:00"},{"id":10313449,"file_name":"bg_1.png","project_id":455043,"asset_id":494547,"created_at":"2022-11-02T15:39:48.284+08:00","updated_at":"2022-11-02T15:39:48.284+08:00"},{"id":10313450,"file_name":"bg_2.png","project_id":455043,"asset_id":494548,"created_at":"2022-11-02T15:39:48.285+08:00","updated_at":"2022-11-02T15:39:48.285+08:00"},{"id":10313451,"file_name":"bg_3.png","project_id":455043,"asset_id":494549,"created_at":"2022-11-02T15:39:48.286+08:00","updated_at":"2022-11-02T15:39:48.286+08:00"},{"id":10313452,"file_name":"p_2.png","project_id":455043,"asset_id":494550,"created_at":"2022-11-02T15:39:48.287+08:00","updated_at":"2022-11-02T15:39:48.287+08:00"},{"id":10313453,"file_name":"p_0.png","project_id":455043,"asset_id":494551,"created_at":"2022-11-02T15:39:48.289+08:00","updated_at":"2022-11-02T15:39:48.289+08:00"},{"id":10313454,"file_name":"p_1.png","project_id":455043,"asset_id":494552,"created_at":"2022-11-02T15:39:48.290+08:00","updated_at":"2022-11-02T15:39:48.290+08:00"},{"id":10313455,"file_name":"shot.mp3","project_id":455043,"asset_id":494553,"created_at":"2022-11-02T15:39:48.291+08:00","updated_at":"2022-11-02T15:39:48.291+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦