{"id":1023896,"student_id":2589,"content":"import random\nfrom game import (\n set_backdrop,\n create_sprite,\n create_sound,\n draw_text,\n key,\n forever,\n stop\n)\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\nrocks = []\nbubbles = []\n\n\nfor i in range(17):\n new_rock_sprite = 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 new_rock_sprite.x = i * 75\n rocks.append(new_rock_sprite)\n\n\nfor i in range(21):\n new_bubble_sprite = create_sprite('bubble.png')\n new_bubble_sprite.x = i * 30\n bubbles.append(new_bubble_sprite)\n\n\ndef loop():\n global vy, level, init_y\n\n for i in range(17):\n rock_sprite = rocks[i]\n rock_sprite.x = rock_sprite.x - 8\n\n if rock_sprite.x \u003c -35:\n rock_sprite.x = rock_sprite.x + 17 * 75\n init_y = init_y + random.randrange(-60, 60)\n\n if init_y \u003e 600:\n init_y = 600\n if init_y \u003c 300:\n init_y = 300\n\n rock_sprite.y = init_y\n level = level + 1\n\n if level \u003c 300:\n rock_sprite.costume_id = level // 30\n else:\n rock_sprite.costume_id = 10\n\n draw_text(str(level) + 'm', 10, 10, 'white', 60)\n\n for i in range(21):\n bubble_sprite = bubbles[i]\n bubble_sprite.x = bubble_sprite.x - 7\n bubble_sprite.y = bubble_sprite.y - 2\n bubble_sprite.scale = bubble_sprite.x / 600\n bubble_sprite.opacity = bubble_sprite.x / 600\n if bubble_sprite.x \u003c -10:\n bubble_sprite.x = player.x - 60 - random.randrange(20)\n bubble_sprite.y = player.y - random.randrange(20)\n\n vy = vy + 0.3\n player.y = player.y + vy\n player.direction = 90 + vy * 2\n\n if key.space == True:\n vy = vy - 0.6\n\n\nforever(loop)\n","created_at":"2025-05-29T12:27:22.050+08:00","updated_at":"2025-05-29T12:28:07.701+08:00","name":"12_A_G_海底探險_正課_【講解】操控潛水艇 副本","language":"python","screenshot":{"url":null},"parent_id":1012139,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":50,"hashid":"ej9s55rmj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":38687149,"file_name":"b5.png","project_id":1023896,"asset_id":251826,"created_at":"2025-05-29T12:27:22.055+08:00","updated_at":"2025-05-29T12:27:22.055+08:00"},{"id":38687150,"file_name":"b4.png","project_id":1023896,"asset_id":251827,"created_at":"2025-05-29T12:27:22.056+08:00","updated_at":"2025-05-29T12:27:22.056+08:00"},{"id":38687151,"file_name":"b3.png","project_id":1023896,"asset_id":251828,"created_at":"2025-05-29T12:27:22.057+08:00","updated_at":"2025-05-29T12:27:22.057+08:00"},{"id":38687152,"file_name":"b2.png","project_id":1023896,"asset_id":251829,"created_at":"2025-05-29T12:27:22.058+08:00","updated_at":"2025-05-29T12:27:22.058+08:00"},{"id":38687153,"file_name":"b1.png","project_id":1023896,"asset_id":251830,"created_at":"2025-05-29T12:27:22.060+08:00","updated_at":"2025-05-29T12:27:22.060+08:00"},{"id":38687154,"file_name":"b0.png","project_id":1023896,"asset_id":251831,"created_at":"2025-05-29T12:27:22.061+08:00","updated_at":"2025-05-29T12:27:22.061+08:00"},{"id":38687155,"file_name":"player.png","project_id":1023896,"asset_id":251832,"created_at":"2025-05-29T12:27:22.061+08:00","updated_at":"2025-05-29T12:27:22.061+08:00"},{"id":38687156,"file_name":"hint.png","project_id":1023896,"asset_id":251833,"created_at":"2025-05-29T12:27:22.062+08:00","updated_at":"2025-05-29T12:27:22.062+08:00"},{"id":38687157,"file_name":"bubble.png","project_id":1023896,"asset_id":251818,"created_at":"2025-05-29T12:27:22.063+08:00","updated_at":"2025-05-29T12:27:22.063+08:00"},{"id":38687158,"file_name":"bg.png","project_id":1023896,"asset_id":251819,"created_at":"2025-05-29T12:27:22.064+08:00","updated_at":"2025-05-29T12:27:22.064+08:00"},{"id":38687159,"file_name":"bg_2.png","project_id":1023896,"asset_id":251820,"created_at":"2025-05-29T12:27:22.065+08:00","updated_at":"2025-05-29T12:27:22.065+08:00"},{"id":38687160,"file_name":"b10.png","project_id":1023896,"asset_id":251821,"created_at":"2025-05-29T12:27:22.066+08:00","updated_at":"2025-05-29T12:27:22.066+08:00"},{"id":38687161,"file_name":"b9.png","project_id":1023896,"asset_id":251822,"created_at":"2025-05-29T12:27:22.067+08:00","updated_at":"2025-05-29T12:27:22.067+08:00"},{"id":38687162,"file_name":"b8.png","project_id":1023896,"asset_id":251823,"created_at":"2025-05-29T12:27:22.068+08:00","updated_at":"2025-05-29T12:27:22.068+08:00"},{"id":38687163,"file_name":"b7.png","project_id":1023896,"asset_id":251824,"created_at":"2025-05-29T12:27:22.069+08:00","updated_at":"2025-05-29T12:27:22.069+08:00"},{"id":38687164,"file_name":"b6.png","project_id":1023896,"asset_id":251825,"created_at":"2025-05-29T12:27:22.070+08:00","updated_at":"2025-05-29T12:27:22.070+08:00"},{"id":38687165,"file_name":"bgm.ogg","project_id":1023896,"asset_id":251834,"created_at":"2025-05-29T12:27:22.071+08:00","updated_at":"2025-05-29T12:27:22.071+08:00"},{"id":38687166,"file_name":"level.wav","project_id":1023896,"asset_id":251835,"created_at":"2025-05-29T12:27:22.072+08:00","updated_at":"2025-05-29T12:27:22.072+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦