{"id":694989,"student_id":10,"content":"from game import *\nfrom random import random, randint\n\nclock = 0\nbullets = []\nzombies = []\n\nplayer = create_sprite('0.png')\n\ndef loop():\n global clock, bullets, zombies, foods\n clock += 1\n \n draw_text(inspector.fps)\n draw_text(len(zombies), 10, 50)\n draw_text(len(bullets), 10, 100)\n \n player.toward(cursor)\n \n if len(zombies) \u003c 300:\n e = create_sprite('4.png')\n e.x = random() * 6000 - 3000\n e.y = random() * 6000 - 3000\n e.life = 3\n zombies.append(e)\n \n if cursor.is_down:\n arr = zombies\n for o in arr:\n o.direction = player.direction - 180\n o.step_forward(5)\n \n for e in zombies:\n if e.costume_id != 1:\n e.toward(player)\n e.step_forward(1)\n \n if clock % 5 == 0:\n b = create_sprite('0.png')\n b.toward(cursor)\n b.scale = 0.2\n bullets.append(b)\n \n if clock % 60 == 0:\n for i in range(12):\n b = create_sprite('0.png')\n b.direction = i * 30\n b.scale = 0.2\n bullets.append(b)\n \n for b in bullets:\n b.step_forward(20)\n for e in zombies:\n if e.touched(b):\n e.life -= 1\n e.step_forward(-10)\n b.hidden = True\n b.destroy()\n \n if e.life == 0:\n e.hidden = True\n e.destroy()\n \n \n if b.x \u003c 0 or b.y \u003c 0 or b.x \u003e 1200 or b.y \u003e 900:\n b.hidden = True\n b.destroy()\n \n bullets = [b for b in bullets if not b.hidden]\n zombies = [e for e in zombies if not e.hidden]\n\n\nforever(loop)","created_at":"2024-02-16T12:31:04.026+08:00","updated_at":"2024-02-19T09:54:20.154+08:00","name":"達達特工","language":"python","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/694989/3f817958dda964f91c260aeea7e4c371.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":71,"hashid":"yeysgnz8j","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":15567207,"file_name":"5.png","project_id":694989,"asset_id":721179,"created_at":"2024-02-16T12:31:43.629+08:00","updated_at":"2024-02-16T12:31:43.629+08:00"},{"id":15567208,"file_name":"4.png","project_id":694989,"asset_id":721180,"created_at":"2024-02-16T12:31:43.631+08:00","updated_at":"2024-02-16T12:31:43.631+08:00"},{"id":15567209,"file_name":"3.png","project_id":694989,"asset_id":721181,"created_at":"2024-02-16T12:31:43.985+08:00","updated_at":"2024-02-16T12:31:43.985+08:00"},{"id":15567210,"file_name":"1.png","project_id":694989,"asset_id":721182,"created_at":"2024-02-16T12:31:43.986+08:00","updated_at":"2024-02-16T12:31:43.986+08:00"},{"id":15567211,"file_name":"0.png","project_id":694989,"asset_id":721183,"created_at":"2024-02-16T12:31:44.346+08:00","updated_at":"2024-02-16T12:31:44.346+08:00"},{"id":15567212,"file_name":"2.png","project_id":694989,"asset_id":721184,"created_at":"2024-02-16T12:31:44.348+08:00","updated_at":"2024-02-16T12:31:44.348+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦