{"id":204892,"student_id":3302,"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\ngame.create_sound('bgm.mp3', ) \n# 遊戲迴圈\ndef loop ():\n global active, count\n \n wheel.direction = wheel.direction + 1\n t1.direction = t1.direction - 0.2\n t2.direction = t2.direction - 0.2\n t3.direction = t3.direction - 0.2\n t4.direction = t4.direction - 0.2\n \n if active == True:\n player.x = cursor.x\n player.y = 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):\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 \n game.draw_text('遊戲時間' + str(count//60) + '/秒', 500, 30, 'white', 30) \n\n\n\n\ngame.forever(loop) #不斷重複執行遊戲迴圈\n","created_at":"2020-11-18T19:06:59.136+08:00","updated_at":"2020-11-18T20:59:35.356+08:00","name":"逃離洞窟(預設版) 副本","language":"python","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/204892/16650260cab691d2603c08ad6d3ed6ae.jpg"},"parent_id":183419,"plugin":"game.set({'width': 1200, 'height': 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":144,"hashid":"rdvs664r2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3549100,"file_name":"1.png","project_id":204892,"asset_id":251889,"created_at":"2020-11-18T19:06:59.143+08:00","updated_at":"2020-11-18T19:06:59.143+08:00"},{"id":3549101,"file_name":"2.png","project_id":204892,"asset_id":251888,"created_at":"2020-11-18T19:06:59.145+08:00","updated_at":"2020-11-18T19:06:59.145+08:00"},{"id":3549102,"file_name":"4.png","project_id":204892,"asset_id":251887,"created_at":"2020-11-18T19:06:59.146+08:00","updated_at":"2020-11-18T19:06:59.146+08:00"},{"id":3549103,"file_name":"bg.png","project_id":204892,"asset_id":251886,"created_at":"2020-11-18T19:06:59.147+08:00","updated_at":"2020-11-18T19:06:59.147+08:00"},{"id":3549104,"file_name":"player.png","project_id":204892,"asset_id":251885,"created_at":"2020-11-18T19:06:59.148+08:00","updated_at":"2020-11-18T19:06:59.148+08:00"},{"id":3549105,"file_name":"t1.png","project_id":204892,"asset_id":251884,"created_at":"2020-11-18T19:06:59.150+08:00","updated_at":"2020-11-18T19:06:59.150+08:00"},{"id":3549106,"file_name":"t2.png","project_id":204892,"asset_id":251883,"created_at":"2020-11-18T19:06:59.151+08:00","updated_at":"2020-11-18T19:06:59.151+08:00"},{"id":3549107,"file_name":"t3.png","project_id":204892,"asset_id":251882,"created_at":"2020-11-18T19:06:59.152+08:00","updated_at":"2020-11-18T19:06:59.152+08:00"},{"id":3549108,"file_name":"t4.png","project_id":204892,"asset_id":251881,"created_at":"2020-11-18T19:06:59.154+08:00","updated_at":"2020-11-18T19:06:59.154+08:00"},{"id":3549109,"file_name":"wheel.png","project_id":204892,"asset_id":251880,"created_at":"2020-11-18T19:06:59.155+08:00","updated_at":"2020-11-18T19:06:59.155+08:00"},{"id":3549110,"file_name":"youwin.png","project_id":204892,"asset_id":251879,"created_at":"2020-11-18T19:06:59.156+08:00","updated_at":"2020-11-18T19:06:59.156+08:00"},{"id":3549111,"file_name":"hit.ogg","project_id":204892,"asset_id":251878,"created_at":"2020-11-18T19:06:59.157+08:00","updated_at":"2020-11-18T19:06:59.157+08:00"},{"id":3549112,"file_name":"bgm.mp3","project_id":204892,"asset_id":251877,"created_at":"2020-11-18T19:06:59.159+08:00","updated_at":"2020-11-18T19:06:59.159+08:00"},{"id":3549113,"file_name":"3.png","project_id":204892,"asset_id":251876,"created_at":"2020-11-18T19:06:59.160+08:00","updated_at":"2020-11-18T19:06:59.160+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦