{"id":228610,"student_id":1940,"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') #轉盤\n #發光的小精靈\nactive = False\ncount = 0\ngame.create_sound('bgm.mp3', True)\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')\nplayer.move_to(50, 50)\nt1.move_to(1200, 900)\nt2.move_to(0, 900)\nt3.move_to(1200, 0)\nt4.move_to(0, 0)\n# 遊戲迴圈\ndef loop ():\n global active, count\n wheel.direction = wheel.direction + 0.4\n t1.direction = t1.direction - 2\n t2.direction = t2.direction - 2\n t3.direction = t3.direction - 2\n t4.direction = t4.direction - 2\n \n if active == True:\n player.y = game.cursor.y\n player.x = game.cursor.x\n count = count + 1\n \n if player.touched(cursor) == True:\n active = True\n \n if player.touched(t1) == True:\n maze.costume_id = 1\n \n if player.touched(t2) == True:\n maze.costume_id = 2\n \n if player.touched(t3) == True:\n maze.costume_id = 3\n \n if player.touched(t4) == True and maze.costume_id == 3:\n maze.costume_id = 4\n wheel.hidden = True\n game.stop()\n \n if player.touched(maze) == True or player.touched(wheel) == True:\n active = False\n if maze.costume_id == 0:\n player.move_to(50,50)\n \n if maze.costume_id == 1:\n player.move_to(1150,850)\n \n if maze.costume_id == 2:\n player.move_to(50,850)\n \n if maze.costume_id == 3:\n player.move_to(1150,50)\n game.create_sound('hit.ogg')\n \n game.draw_text('Game Time: ' + str(count//60) + ' Seconds', 500, 30, 'white', 30)\ngame.forever(loop) #不斷重複執行遊戲迴圈\n","created_at":"2021-02-07T13:36:22.998+08:00","updated_at":"2021-02-07T14:28:06.626+08:00","name":"逃離洞窟(預設版) 副本","language":"python","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/228610/00ceb1e79393804a58cec501f7f5fa9a.jpg"},"parent_id":183419,"plugin":"game.set({'width': 1200, 'height': 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":89,"hashid":"882sqnkvj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4084599,"file_name":"3.png","project_id":228610,"asset_id":251876,"created_at":"2021-02-07T13:36:23.003+08:00","updated_at":"2021-02-07T13:36:23.003+08:00"},{"id":4084600,"file_name":"bgm.mp3","project_id":228610,"asset_id":251877,"created_at":"2021-02-07T13:36:23.004+08:00","updated_at":"2021-02-07T13:36:23.004+08:00"},{"id":4084601,"file_name":"hit.ogg","project_id":228610,"asset_id":251878,"created_at":"2021-02-07T13:36:23.005+08:00","updated_at":"2021-02-07T13:36:23.005+08:00"},{"id":4084602,"file_name":"youwin.png","project_id":228610,"asset_id":251879,"created_at":"2021-02-07T13:36:23.006+08:00","updated_at":"2021-02-07T13:36:23.006+08:00"},{"id":4084603,"file_name":"wheel.png","project_id":228610,"asset_id":251880,"created_at":"2021-02-07T13:36:23.007+08:00","updated_at":"2021-02-07T13:36:23.007+08:00"},{"id":4084604,"file_name":"t4.png","project_id":228610,"asset_id":251881,"created_at":"2021-02-07T13:36:23.008+08:00","updated_at":"2021-02-07T13:36:23.008+08:00"},{"id":4084605,"file_name":"t3.png","project_id":228610,"asset_id":251882,"created_at":"2021-02-07T13:36:23.009+08:00","updated_at":"2021-02-07T13:36:23.009+08:00"},{"id":4084606,"file_name":"t2.png","project_id":228610,"asset_id":251883,"created_at":"2021-02-07T13:36:23.010+08:00","updated_at":"2021-02-07T13:36:23.010+08:00"},{"id":4084607,"file_name":"t1.png","project_id":228610,"asset_id":251884,"created_at":"2021-02-07T13:36:23.011+08:00","updated_at":"2021-02-07T13:36:23.011+08:00"},{"id":4084608,"file_name":"player.png","project_id":228610,"asset_id":251885,"created_at":"2021-02-07T13:36:23.012+08:00","updated_at":"2021-02-07T13:36:23.012+08:00"},{"id":4084609,"file_name":"bg.png","project_id":228610,"asset_id":251886,"created_at":"2021-02-07T13:36:23.013+08:00","updated_at":"2021-02-07T13:36:23.013+08:00"},{"id":4084610,"file_name":"4.png","project_id":228610,"asset_id":251887,"created_at":"2021-02-07T13:36:23.014+08:00","updated_at":"2021-02-07T13:36:23.014+08:00"},{"id":4084611,"file_name":"2.png","project_id":228610,"asset_id":251888,"created_at":"2021-02-07T13:36:23.015+08:00","updated_at":"2021-02-07T13:36:23.015+08:00"},{"id":4084612,"file_name":"1.png","project_id":228610,"asset_id":251889,"created_at":"2021-02-07T13:36:23.016+08:00","updated_at":"2021-02-07T13:36:23.016+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦