{"id":180147,"student_id":130,"content":"import game\nimport random #載入產生隨機數的套件\n#設定背景\n#背景圖1\n# 建立雲朵\n #背景圖2\n# 建立牛仔\ngame.create_sprite('bg_0.png')\nshot=game.create_sound(\"shot.wav\") #創造角色\nwind0=game.create_sprite('cloud_1.png')\nwind1=game.create_sprite('cloud_2.png')\nwind2=game.create_sprite('cloud_3.png')\ngame.create_sprite('bg_1.png')\nwq1=game.create_sprite(\"info.png\")\np2=game.create_sprite(\"p2_3.png\",\"p2_2.png\",\"p2_1.png\",\"p2_0.png\")\np1=game.create_sprite(\"p1_3.png\",\"p1_2.png\",\"p1_1.png\",\"p1_0.png\")\nbgm = game.create_sound('bgm.mp3')\np1.x=600\np1.y=700\np2.x=600\np2.y=700\np1.costume_id=3\np2.costume_id=3\nwind0.x=700\nwind0.y=300\nwind1.x=200\nwind1.y=150\nwind2.x=1100\nwind2.y=50\n# 建立遊戲說明\n #移動的剩餘步數\nshot.mute(True) \np1.hidden=True\np2.hidden=True\ngame_over = True \nwq1.hidden=False\nbgm.mute(True)\nsteps = -1\n# 角色初始化\n# 遊戲主迴圈\ndef loop ():\n global steps, game_over\n if key.r:\n steps=random.randint(100,500)\n wq1.hidden=True\n p1.hidden=False\n p2.hidden=False\n bgm.mute(False) \n game_over = False\n \n p2.x=600\n p2.y=700\n p1.x=600\n p1y=700\n p2.costume_id=3\n p1.costume_id=3\n \n if steps\u003e0:\n p2.x+=1\n p1.x-=1\n steps-=1\n \n elif steps==0:\n p2.costume_id=2\n p1.costume_id=2\n steps=-1\n bgm.mute(True) \n # 牛仔向左右移動\n # 牛仔射擊\n elif steps==-1 and key.space:\n steps=-2\n p2.costume_id=0\n p1.costumer_id=1\n shot.mute(False) \n game_over = True\n \n elif steps==-1 and key.enter:\n steps=-2\n p2.costume_id=1\n p1.costume_id=0\n shot.mute(False) \n game_over = True\n \n \n wind0.x-=0.3\n wind1.x-=0.5\n wind2.x-=0.7\n if wind0.x\u003c-200 :\n wind0.x+=1500\n if wind1.x\u003c-200 :\n wind1.x+=1500\n if wind2.x\u003c-200 :\n wind2.x+=1500\n \n # 遊戲開始、重新開始\n # 雲朵移動\ngame.forever(loop) #不斷執行遊戲迴圈","created_at":"2020-08-12T13:10:20.816+08:00","updated_at":"2020-08-12T21:38:10.139+08:00","name":"牛仔大對決_S 副本","language":"python","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/180147/563bd3395b8945366ab5cdf10987d354.jpg"},"parent_id":162840,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":65,"hashid":"rdvsqn8n","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3071715,"file_name":"bg_0.png","project_id":180147,"asset_id":192575,"created_at":"2020-08-12T13:10:20.825+08:00","updated_at":"2020-08-12T13:10:20.825+08:00"},{"id":3071716,"file_name":"bg_1.png","project_id":180147,"asset_id":192574,"created_at":"2020-08-12T13:10:20.826+08:00","updated_at":"2020-08-12T13:10:20.826+08:00"},{"id":3071717,"file_name":"bgm.mp3","project_id":180147,"asset_id":172549,"created_at":"2020-08-12T13:10:20.827+08:00","updated_at":"2020-08-12T13:10:20.827+08:00"},{"id":3071718,"file_name":"cloud_1.png","project_id":180147,"asset_id":192679,"created_at":"2020-08-12T13:10:20.828+08:00","updated_at":"2020-08-12T13:10:20.828+08:00"},{"id":3071719,"file_name":"cloud_2.png","project_id":180147,"asset_id":192577,"created_at":"2020-08-12T13:10:20.829+08:00","updated_at":"2020-08-12T13:10:20.829+08:00"},{"id":3071720,"file_name":"cloud_3.png","project_id":180147,"asset_id":192578,"created_at":"2020-08-12T13:10:20.830+08:00","updated_at":"2020-08-12T13:10:20.830+08:00"},{"id":3071721,"file_name":"info.png","project_id":180147,"asset_id":192685,"created_at":"2020-08-12T13:10:20.831+08:00","updated_at":"2020-08-12T13:10:20.831+08:00"},{"id":3071722,"file_name":"p1_0.png","project_id":180147,"asset_id":192671,"created_at":"2020-08-12T13:10:20.832+08:00","updated_at":"2020-08-12T13:10:20.832+08:00"},{"id":3071723,"file_name":"p1_1.png","project_id":180147,"asset_id":192672,"created_at":"2020-08-12T13:10:20.833+08:00","updated_at":"2020-08-12T13:10:20.833+08:00"},{"id":3071724,"file_name":"p1_2.png","project_id":180147,"asset_id":192673,"created_at":"2020-08-12T13:10:20.834+08:00","updated_at":"2020-08-12T13:10:20.834+08:00"},{"id":3071725,"file_name":"p1_3.png","project_id":180147,"asset_id":192674,"created_at":"2020-08-12T13:10:20.835+08:00","updated_at":"2020-08-12T13:10:20.835+08:00"},{"id":3071726,"file_name":"p2_0.png","project_id":180147,"asset_id":192675,"created_at":"2020-08-12T13:10:20.836+08:00","updated_at":"2020-08-12T13:10:20.836+08:00"},{"id":3071727,"file_name":"p2_1.png","project_id":180147,"asset_id":192676,"created_at":"2020-08-12T13:10:20.837+08:00","updated_at":"2020-08-12T13:10:20.837+08:00"},{"id":3071728,"file_name":"p2_2.png","project_id":180147,"asset_id":192677,"created_at":"2020-08-12T13:10:20.838+08:00","updated_at":"2020-08-12T13:10:20.838+08:00"},{"id":3071729,"file_name":"p2_3.png","project_id":180147,"asset_id":192678,"created_at":"2020-08-12T13:10:20.839+08:00","updated_at":"2020-08-12T13:10:20.839+08:00"},{"id":3071730,"file_name":"shot.wav","project_id":180147,"asset_id":17859,"created_at":"2020-08-12T13:10:20.840+08:00","updated_at":"2020-08-12T13:10:20.840+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦