{"id":242154,"student_id":1998,"content":" import game #載入遊戲框架\n\ngame.set_backdrop('bg.png') #設定背景圖\nmaze = game.create_sprite('1.png', '2.png', '3.png', '4.png', 'youwin.png') #遊戲關卡\nwheel = game.create_sprite('wheel.png') #轉盤\nplayer = game.create_sprite('player.png') #發光的小精靈\nt1 = game.create_sprite(\"t1.png\") #創造角色\nt2 = game.create_sprite(\"t2.png\") #創造角色\nt3 = game.create_sprite(\"t3.png\") #創造角色\nt4 = game.create_sprite(\"t4.png\") #創造角色\nplayer = game.create_sprite(\"player.png\") #創造角色\nt1.move_to(1200,900)\nt2.move_to(0,900)\nt3.move_to(1200,0)\nt4.move_to(0,0)\nplayer.move_to(50, 50)\nactive = True\ncount = 0\ngame.create_sound('bgm.mp3', True)\n# 遊戲迴圈\ndef loop ():\n global active, count\n wheel.direction = wheel.direction + 1\n t1.direction = t1.direction - 0.4\n t2.direction = t2.direction - 0.4\n t3.direction = t3.direction - 0.4\n t4.direction = t4.direction - 0.4\n if active == True:\n player.x = game.cursor.x\n player.y = game.cursor.y\n count = count + 1\n if player.touched(cursor) == True:\n active = True\n if player.touched(t1) == True:\n maze.costume_id = 1\n if player.touched(t2) == True:\n maze.costume_id = 2\n if player.touched(t3) == True:\n maze.costume_id = 3\n if player.touched(t4) == True and maze.costume_id == 3:\n maze.costume_id = 4\n wheel.hidden = True\n game.stop\n if player.touched(maze) or player.touched(wheel) == True:\n active = False\n if maze.costume_id == 0:\n player.move_to(50, 50)\n if maze.costume_id == 1:\n player.move_to(1150, 850)\n if maze.costume_id == 2:\n player.move_to(50, 850)\n if maze.costume_id == 3:\n player.move_to(1150, 50)\n game.create_sound('hit.ogg')\n game.draw_text('遊戲時間' + str(count//60) + '秒', 500, 30,'white', 30)\n \n \ngame.forever(loop) #不斷重複執行遊戲迴圈\n","created_at":"2021-04-10T16:07:29.914+08:00","updated_at":"2021-05-04T21:10:26.515+08:00","name":"逃離洞窟(預設版) 副本","language":"python","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/242154/78c61e7f1ead7988a942b4dbd445e807.jpg"},"parent_id":183419,"plugin":"game.set({'width': 1200, 'height': 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":27,"hashid":"36ysm5ydy","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4471609,"file_name":"3.png","project_id":242154,"asset_id":251876,"created_at":"2021-04-10T16:07:29.919+08:00","updated_at":"2021-04-10T16:07:29.919+08:00"},{"id":4471610,"file_name":"bgm.mp3","project_id":242154,"asset_id":251877,"created_at":"2021-04-10T16:07:29.920+08:00","updated_at":"2021-04-10T16:07:29.920+08:00"},{"id":4471611,"file_name":"hit.ogg","project_id":242154,"asset_id":251878,"created_at":"2021-04-10T16:07:29.920+08:00","updated_at":"2021-04-10T16:07:29.920+08:00"},{"id":4471612,"file_name":"youwin.png","project_id":242154,"asset_id":251879,"created_at":"2021-04-10T16:07:29.921+08:00","updated_at":"2021-04-10T16:07:29.921+08:00"},{"id":4471613,"file_name":"wheel.png","project_id":242154,"asset_id":251880,"created_at":"2021-04-10T16:07:29.922+08:00","updated_at":"2021-04-10T16:07:29.922+08:00"},{"id":4471614,"file_name":"t4.png","project_id":242154,"asset_id":251881,"created_at":"2021-04-10T16:07:29.923+08:00","updated_at":"2021-04-10T16:07:29.923+08:00"},{"id":4471615,"file_name":"t3.png","project_id":242154,"asset_id":251882,"created_at":"2021-04-10T16:07:29.924+08:00","updated_at":"2021-04-10T16:07:29.924+08:00"},{"id":4471616,"file_name":"t2.png","project_id":242154,"asset_id":251883,"created_at":"2021-04-10T16:07:29.925+08:00","updated_at":"2021-04-10T16:07:29.925+08:00"},{"id":4471617,"file_name":"t1.png","project_id":242154,"asset_id":251884,"created_at":"2021-04-10T16:07:29.926+08:00","updated_at":"2021-04-10T16:07:29.926+08:00"},{"id":4471618,"file_name":"player.png","project_id":242154,"asset_id":251885,"created_at":"2021-04-10T16:07:29.926+08:00","updated_at":"2021-04-10T16:07:29.926+08:00"},{"id":4471619,"file_name":"bg.png","project_id":242154,"asset_id":251886,"created_at":"2021-04-10T16:07:29.927+08:00","updated_at":"2021-04-10T16:07:29.927+08:00"},{"id":4471620,"file_name":"4.png","project_id":242154,"asset_id":251887,"created_at":"2021-04-10T16:07:29.928+08:00","updated_at":"2021-04-10T16:07:29.928+08:00"},{"id":4471621,"file_name":"2.png","project_id":242154,"asset_id":251888,"created_at":"2021-04-10T16:07:29.929+08:00","updated_at":"2021-04-10T16:07:29.929+08:00"},{"id":4471622,"file_name":"1.png","project_id":242154,"asset_id":251889,"created_at":"2021-04-10T16:07:29.930+08:00","updated_at":"2021-04-10T16:07:29.930+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦