{"id":233574,"student_id":1998,"content":"import game #載入遊戲套件\nimport random #引入隨機函式庫\n\ngame.set_backdrop('bg.png') #設定背景圖\np1 = game.create_sprite('pipes.png') #1號水管\np2 = game.create_sprite('pipes.png') #2號水管\np3 = game.create_sprite('pipes.png') #3號水管\ngd = game.create_sprite('ground.png') #地板\nbird = game.create_sprite('bird_1.png', 'bird_2.png') #小鳥\nhint = game.create_sprite('hint.png') #按鍵示意圖\nend = game.create_sprite('gameover.png') #遊戲結束示意圖\n\nhint.hidden = True\nend.hidden = True\n\n\nspeed = 0 #鳥的垂直速度\nscore = 0 #遊戲分數\nstart = False #是否開始遊戲\n\n\n\n#遊戲迴圈\ndef loop():\n moveGround() #捲動地板\n movePipes(p1) #移動1號水管\n movePipes(p2) #移動2號水管\n movePipes(p3) #移動3號水管\n moveBird() #移動鳥\n \n\n\n#移動地板\ndef moveGround ():\n pass\n\n#移動水管\ndef movePipes (pipe):\n global score\n \n#鳥的墜落 \u0026 翅膀動畫\ndef moveBird ():\n global speed\n \n \n#鳥的跳躍\ndef jump ():\n global speed, start\n \n# 遊戲結束\ndef gameover (t):\n pass\n\n\ngame.forever(loop) #不斷執行遊戲迴圈\ngame.on('keydown', jump) #按下任意按鍵使鳥跳躍\nbird.on('touch', [p1, p2, p3, gd], gameover); #鳥撞到水管或地板就結束遊戲\n\n","created_at":"2021-03-07T13:57:51.238+08:00","updated_at":"2021-05-04T21:09:56.983+08:00","name":"跳躍吧!小鳥(預設版) 副本","language":"python","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/233574/8f30c6ea46ffcee9f3d82845536ac387.jpg"},"parent_id":183417,"plugin":"game.set({'width': 1200, 'height': 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":39,"hashid":"kdms6yyem","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4214455,"file_name":"bg.png","project_id":233574,"asset_id":251845,"created_at":"2021-03-07T13:57:51.251+08:00","updated_at":"2021-03-07T13:57:51.251+08:00"},{"id":4214446,"file_name":"hint.png","project_id":233574,"asset_id":251836,"created_at":"2021-03-07T13:57:51.243+08:00","updated_at":"2021-03-07T13:57:51.243+08:00"},{"id":4214447,"file_name":"gg.mp3","project_id":233574,"asset_id":251837,"created_at":"2021-03-07T13:57:51.244+08:00","updated_at":"2021-03-07T13:57:51.244+08:00"},{"id":4214448,"file_name":"jump.mp3","project_id":233574,"asset_id":251838,"created_at":"2021-03-07T13:57:51.245+08:00","updated_at":"2021-03-07T13:57:51.245+08:00"},{"id":4214449,"file_name":"bgm.mp3","project_id":233574,"asset_id":251839,"created_at":"2021-03-07T13:57:51.246+08:00","updated_at":"2021-03-07T13:57:51.246+08:00"},{"id":4214450,"file_name":"pipes.png","project_id":233574,"asset_id":251840,"created_at":"2021-03-07T13:57:51.246+08:00","updated_at":"2021-03-07T13:57:51.246+08:00"},{"id":4214451,"file_name":"ground.png","project_id":233574,"asset_id":251841,"created_at":"2021-03-07T13:57:51.247+08:00","updated_at":"2021-03-07T13:57:51.247+08:00"},{"id":4214452,"file_name":"gameover.png","project_id":233574,"asset_id":251842,"created_at":"2021-03-07T13:57:51.248+08:00","updated_at":"2021-03-07T13:57:51.248+08:00"},{"id":4214453,"file_name":"bird_2.png","project_id":233574,"asset_id":251843,"created_at":"2021-03-07T13:57:51.249+08:00","updated_at":"2021-03-07T13:57:51.249+08:00"},{"id":4214454,"file_name":"bird_1.png","project_id":233574,"asset_id":251844,"created_at":"2021-03-07T13:57:51.250+08:00","updated_at":"2021-03-07T13:57:51.250+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦