{"id":335280,"student_id":10,"content":"import game #載入遊戲套件\nimport random #載入隨機數套件\n\ngame.set_backdrop('bg.jpg') #設定背景圖\nswing = game.create_sprite('swing_0.png', 'swing_1.png') #盪鞦韆與叩叮\napple = game.create_sprite('apple.png') #蘋果\narcher = game.create_sprite('archer.png') #弓箭手\nbow = game.create_sprite('bow.png') #弓\narrow = game.create_sprite('arrow_0.png', 'arrow_1.png') #箭\n\nswing.x = 900\napple.x = 900\nswing.y = 400\napple.y = 400\n\narcher.y = 600\narcher.x = 200\nbow.y = 600\nbow.x = 200\narrow.y = 600\narrow.x = 200\n\nactive = False #紀錄是否拉過弓\nscore = 0 #玩家得分\n\n#遊戲主迴圈\ndef loop ():\n global active, score\n \n \n \n \n # 如果箭超出下面邊界或右邊邊界\n if arrow.y \u003e 900 or arrow.x \u003e 1300:\n arrow.move_to(200, 600) #重置箭的位置\n arrow.direction = 135 #重置箭的角度\n bow.direction = 135 #重置弓的角度\n active = False #狀態改為沒有拉過弓\n apple.hidden = False #顯示蘋果\n \n if arrow.costume_id == 1: #如果是插著蘋果的造型\n rand = random.randrange(300, 600)\n koding.y = rand\n target.y = rand\n \n arrow.costume_id = 0\n \n\ngame.forever(loop) #重複不斷執行\n","created_at":"2022-01-13T15:18:29.771+08:00","updated_at":"2022-01-25T16:03:15.703+08:00","name":"射箭遊戲(預設版)","language":"python","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/335280/bc0abba9238ed2436b55839bbb1c99ca.jpg"},"parent_id":194470,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":157,"hashid":"meyswjvgj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":7147389,"file_name":"gameover.png","project_id":335280,"asset_id":267838,"created_at":"2022-01-13T15:18:29.777+08:00","updated_at":"2022-01-13T15:18:29.777+08:00"},{"id":7147390,"file_name":"bg.jpg","project_id":335280,"asset_id":267839,"created_at":"2022-01-13T15:18:29.779+08:00","updated_at":"2022-01-13T15:18:29.779+08:00"},{"id":7147391,"file_name":"swing_1.png","project_id":335280,"asset_id":267840,"created_at":"2022-01-13T15:18:29.780+08:00","updated_at":"2022-01-13T15:18:29.780+08:00"},{"id":7147392,"file_name":"swing_0.png","project_id":335280,"asset_id":267841,"created_at":"2022-01-13T15:18:29.781+08:00","updated_at":"2022-01-13T15:18:29.781+08:00"},{"id":7147393,"file_name":"0.png","project_id":335280,"asset_id":267842,"created_at":"2022-01-13T15:18:29.783+08:00","updated_at":"2022-01-13T15:18:29.783+08:00"},{"id":7147394,"file_name":"1.png","project_id":335280,"asset_id":267843,"created_at":"2022-01-13T15:18:29.784+08:00","updated_at":"2022-01-13T15:18:29.784+08:00"},{"id":7147395,"file_name":"2.png","project_id":335280,"asset_id":267844,"created_at":"2022-01-13T15:18:29.785+08:00","updated_at":"2022-01-13T15:18:29.785+08:00"},{"id":7147396,"file_name":"3.png","project_id":335280,"asset_id":267845,"created_at":"2022-01-13T15:18:29.787+08:00","updated_at":"2022-01-13T15:18:29.787+08:00"},{"id":7147397,"file_name":"4.png","project_id":335280,"asset_id":267846,"created_at":"2022-01-13T15:18:29.788+08:00","updated_at":"2022-01-13T15:18:29.788+08:00"},{"id":7147398,"file_name":"5.png","project_id":335280,"asset_id":267847,"created_at":"2022-01-13T15:18:29.789+08:00","updated_at":"2022-01-13T15:18:29.789+08:00"},{"id":7147399,"file_name":"arrow_1.png","project_id":335280,"asset_id":267848,"created_at":"2022-01-13T15:18:29.790+08:00","updated_at":"2022-01-13T15:18:29.790+08:00"},{"id":7147400,"file_name":"archer.png","project_id":335280,"asset_id":267849,"created_at":"2022-01-13T15:18:29.791+08:00","updated_at":"2022-01-13T15:18:29.791+08:00"},{"id":7147401,"file_name":"arrow_0.png","project_id":335280,"asset_id":267850,"created_at":"2022-01-13T15:18:29.793+08:00","updated_at":"2022-01-13T15:18:29.793+08:00"},{"id":7147402,"file_name":"bow.png","project_id":335280,"asset_id":267851,"created_at":"2022-01-13T15:18:29.794+08:00","updated_at":"2022-01-13T15:18:29.794+08:00"},{"id":7147403,"file_name":"apple.png","project_id":335280,"asset_id":267852,"created_at":"2022-01-13T15:18:29.795+08:00","updated_at":"2022-01-13T15:18:29.795+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦