{"id":176367,"student_id":10,"content":"import random #載入產生隨機數的套件\nfrom game import (\n create_sprite, #創造角色\n create_sound, #創造音效\n draw_text, #繪製文字\n key, #鍵盤狀態\n forever, #重複不斷執行\n stop, #遊戲結束\n)\n\nbg = create_sprite('bg.png') #背景圖\nplayer = create_sprite('player.png') #潛水艇\nhint = create_sprite('hint.png') #提示教學\n\nhint.hidden = True\n\nvy = 0 #墜落速度\nlevel = 0 #分數\ninit_y = 450 #最新產生的障礙物Y座標\nrocks = [] #存放水晶\nbubbles = [] #存放泡泡\n\n#初始化 17 個水晶角色\nfor i in range(17):\n r = create_sprite('b0.png', 'b1.png', 'b2.png','b3.png', 'b4.png', 'b5.png', 'b6.png', 'b7.png', 'b8.png', 'b9.png', 'b10.png')\n r.x = i * 75\n rocks.append(r)\n\n#初始化 21 個泡泡角色\nfor i in range(21):\n b = create_sprite('bubble.png')\n b.x = i * 30\n bubbles.append(b)\n\n\n#遊戲主迴圈\ndef loop ():\n global vy, level, init_y\n \n #水晶的移動\n for i in range(17):\n r = rocks[i]\n r.x -= 8\n if r.x \u003c -35:\n r.x += 1275\n \n for i in range(21):\n b = bubbles[i]\n b.x -= 7\n b.y -= 2\n if b.x \u003c -10:\n b.x = \n b.y = \n \n \n \n\n\ngame.forever(loop) #重複不斷執行遊戲回圈\n\n\n","created_at":"2020-08-03T11:23:31.706+08:00","updated_at":"2020-10-21T11:30:35.036+08:00","name":"海底探險(錄影版) ","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/176367/f8d3468a94f8adc84d8ca75428aa95d2.jpg"},"parent_id":176292,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":235,"hashid":"jzmsgygd","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3024111,"file_name":"level.wav","project_id":176367,"asset_id":230826,"created_at":"2020-08-03T11:23:31.712+08:00","updated_at":"2020-08-03T11:23:31.712+08:00"},{"id":3024112,"file_name":"bgm.ogg","project_id":176367,"asset_id":170605,"created_at":"2020-08-03T11:23:31.713+08:00","updated_at":"2020-08-03T11:23:31.713+08:00"},{"id":3024113,"file_name":"hint.png","project_id":176367,"asset_id":246016,"created_at":"2020-08-03T11:23:31.714+08:00","updated_at":"2020-08-03T11:23:31.714+08:00"},{"id":3024114,"file_name":"player.png","project_id":176367,"asset_id":200359,"created_at":"2020-08-03T11:23:31.715+08:00","updated_at":"2020-08-03T11:23:31.715+08:00"},{"id":3024115,"file_name":"b0.png","project_id":176367,"asset_id":200369,"created_at":"2020-08-03T11:23:31.716+08:00","updated_at":"2020-08-03T11:23:31.716+08:00"},{"id":3024116,"file_name":"b1.png","project_id":176367,"asset_id":200370,"created_at":"2020-08-03T11:23:31.717+08:00","updated_at":"2020-08-03T11:23:31.717+08:00"},{"id":3024117,"file_name":"b2.png","project_id":176367,"asset_id":200371,"created_at":"2020-08-03T11:23:31.718+08:00","updated_at":"2020-08-03T11:23:31.718+08:00"},{"id":3024118,"file_name":"b3.png","project_id":176367,"asset_id":200372,"created_at":"2020-08-03T11:23:31.719+08:00","updated_at":"2020-08-03T11:23:31.719+08:00"},{"id":3024119,"file_name":"b4.png","project_id":176367,"asset_id":200373,"created_at":"2020-08-03T11:23:31.720+08:00","updated_at":"2020-08-03T11:23:31.720+08:00"},{"id":3024120,"file_name":"b5.png","project_id":176367,"asset_id":200374,"created_at":"2020-08-03T11:23:31.721+08:00","updated_at":"2020-08-03T11:23:31.721+08:00"},{"id":3024121,"file_name":"b6.png","project_id":176367,"asset_id":200375,"created_at":"2020-08-03T11:23:31.722+08:00","updated_at":"2020-08-03T11:23:31.722+08:00"},{"id":3024122,"file_name":"b7.png","project_id":176367,"asset_id":200376,"created_at":"2020-08-03T11:23:31.723+08:00","updated_at":"2020-08-03T11:23:31.723+08:00"},{"id":3024123,"file_name":"b8.png","project_id":176367,"asset_id":200377,"created_at":"2020-08-03T11:23:31.724+08:00","updated_at":"2020-08-03T11:23:31.724+08:00"},{"id":3024124,"file_name":"b9.png","project_id":176367,"asset_id":200378,"created_at":"2020-08-03T11:23:31.725+08:00","updated_at":"2020-08-03T11:23:31.725+08:00"},{"id":3024125,"file_name":"b10.png","project_id":176367,"asset_id":200379,"created_at":"2020-08-03T11:23:31.725+08:00","updated_at":"2020-08-03T11:23:31.725+08:00"},{"id":3024126,"file_name":"bg_2.png","project_id":176367,"asset_id":201851,"created_at":"2020-08-03T11:23:31.726+08:00","updated_at":"2020-08-03T11:23:31.726+08:00"},{"id":3024127,"file_name":"bg.png","project_id":176367,"asset_id":201852,"created_at":"2020-08-03T11:23:31.727+08:00","updated_at":"2020-08-03T11:23:31.727+08:00"},{"id":3024128,"file_name":"bubble.png","project_id":176367,"asset_id":200358,"created_at":"2020-08-03T11:23:31.728+08:00","updated_at":"2020-08-03T11:23:31.728+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦