{"id":786175,"student_id":58026,"content":"pip install pygame\r\n\r\nimport pygame\r\nimport random\r\n\r\n# 初始化Pygame\r\npygame.init()\r\n\r\n# 設置遊戲視窗大小\r\nscreen_width = 800\r\nscreen_height = 600\r\nscreen = pygame.display.set_mode((screen_width, screen_height))\r\npygame.display.set_caption(\"競技場戰鬥遊戲\")\r\n\r\n# 設置顏色\r\nWHITE = (255, 255, 255)\r\nBLACK = (0, 0, 0)\r\nRED = (255, 0, 0)\r\nGREEN = (0, 255, 0)\r\nBLUE = (0, 0, 255)\r\n\r\n# 玩家角色類\r\nclass Player(pygame.sprite.Sprite):\r\n def __init__(self):\r\n super().__init__()\r\n self.image = pygame.Surface((50, 50))\r\n self.image.fill(BLUE)\r\n self.rect = self.image.get_rect()\r\n self.rect.center = (screen_width // 2, screen_height // 2)\r\n","created_at":"2024-07-06T20:41:21.849+08:00","updated_at":"2024-07-06T20:42:17.523+08:00","name":"戰鬥遊戲3","language":"python","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/786175/1a8751143ccad470d05353353d0c5c28.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":1,"hashid":"yeys4z6d8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17485853,"file_name":"cloud.png","project_id":786175,"asset_id":302343,"created_at":"2024-07-06T20:41:21.854+08:00","updated_at":"2024-07-06T20:41:21.854+08:00"},{"id":17485854,"file_name":"bg.jpg","project_id":786175,"asset_id":302344,"created_at":"2024-07-06T20:41:21.855+08:00","updated_at":"2024-07-06T20:41:21.855+08:00"},{"id":17485855,"file_name":"calm.mp3","project_id":786175,"asset_id":302345,"created_at":"2024-07-06T20:41:21.856+08:00","updated_at":"2024-07-06T20:41:21.856+08:00"},{"id":17485856,"file_name":"koding.png","project_id":786175,"asset_id":302346,"created_at":"2024-07-06T20:41:21.857+08:00","updated_at":"2024-07-06T20:41:21.857+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦