{"id":306779,"student_id":3525,"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') #轉盤\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') #發光的小精靈\n\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\nactive = False\ncount = 0\n# 遊戲迴圈\ndef loop ():\n global active, count\n wheel.direction += 1\n t1.direction -= 0.2\n t2.direction += 0.2\n t3.direction += 0.2\n t4.direction -= 0.2\n \n if player.touched(cursor) == True:\n active = True\n \n if active == True:\n player.x = cursor.x\n player.y = cursor.y\n count += 1\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 \n if active == False:\n if maze.costume_id == 4:\n game.draw_text(\"Your Time:\" + str(count//6/10) + \" seconds\", 450, 30, \"white\", 30)\n else:\n game.draw_text(\"Move your cursor to the player to start or continue time.\", 240, 30, \"white\", 30)\n if active == True:\n game.draw_text(\"Your Time:\" + str(count//6/10) + \" seconds\", 450, 30, \"white\", 30)\n\n\ngame.forever(loop) #不斷重複執行遊戲迴圈\n","created_at":"2021-10-23T10:23:01.418+08:00","updated_at":"2021-10-23T12:04:43.281+08:00","name":"逃離洞窟(預設版) 副本","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/306779/3367baef385f9cbb453f7e68c68d0496.jpg"},"parent_id":183419,"plugin":"game.set({'width': 1200, 'height': 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":69,"hashid":"jzmse3kjp","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":6252336,"file_name":"3.png","project_id":306779,"asset_id":251876,"created_at":"2021-10-23T10:23:01.429+08:00","updated_at":"2021-10-23T10:23:01.429+08:00"},{"id":6252337,"file_name":"bgm.mp3","project_id":306779,"asset_id":251877,"created_at":"2021-10-23T10:23:01.430+08:00","updated_at":"2021-10-23T10:23:01.430+08:00"},{"id":6252338,"file_name":"hit.ogg","project_id":306779,"asset_id":251878,"created_at":"2021-10-23T10:23:01.432+08:00","updated_at":"2021-10-23T10:23:01.432+08:00"},{"id":6252339,"file_name":"youwin.png","project_id":306779,"asset_id":251879,"created_at":"2021-10-23T10:23:01.433+08:00","updated_at":"2021-10-23T10:23:01.433+08:00"},{"id":6252340,"file_name":"wheel.png","project_id":306779,"asset_id":251880,"created_at":"2021-10-23T10:23:01.434+08:00","updated_at":"2021-10-23T10:23:01.434+08:00"},{"id":6252341,"file_name":"t4.png","project_id":306779,"asset_id":251881,"created_at":"2021-10-23T10:23:01.438+08:00","updated_at":"2021-10-23T10:23:01.438+08:00"},{"id":6252342,"file_name":"t3.png","project_id":306779,"asset_id":251882,"created_at":"2021-10-23T10:23:01.439+08:00","updated_at":"2021-10-23T10:23:01.439+08:00"},{"id":6252343,"file_name":"t2.png","project_id":306779,"asset_id":251883,"created_at":"2021-10-23T10:23:01.441+08:00","updated_at":"2021-10-23T10:23:01.441+08:00"},{"id":6252344,"file_name":"t1.png","project_id":306779,"asset_id":251884,"created_at":"2021-10-23T10:23:01.442+08:00","updated_at":"2021-10-23T10:23:01.442+08:00"},{"id":6252345,"file_name":"player.png","project_id":306779,"asset_id":251885,"created_at":"2021-10-23T10:23:01.443+08:00","updated_at":"2021-10-23T10:23:01.443+08:00"},{"id":6252346,"file_name":"bg.png","project_id":306779,"asset_id":251886,"created_at":"2021-10-23T10:23:01.444+08:00","updated_at":"2021-10-23T10:23:01.444+08:00"},{"id":6252347,"file_name":"4.png","project_id":306779,"asset_id":251887,"created_at":"2021-10-23T10:23:01.446+08:00","updated_at":"2021-10-23T10:23:01.446+08:00"},{"id":6252348,"file_name":"2.png","project_id":306779,"asset_id":251888,"created_at":"2021-10-23T10:23:01.447+08:00","updated_at":"2021-10-23T10:23:01.447+08:00"},{"id":6252349,"file_name":"1.png","project_id":306779,"asset_id":251889,"created_at":"2021-10-23T10:23:01.448+08:00","updated_at":"2021-10-23T10:23:01.448+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦