{"id":2616,"date":"2025-05-22T18:00:21","date_gmt":"2025-05-22T10:00:21","guid":{"rendered":"https:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/"},"modified":"2025-05-22T18:00:21","modified_gmt":"2025-05-22T10:00:21","slug":"%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9","status":"publish","type":"post","link":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/","title":{"rendered":"\u5c04\u51fb\u6e38\u620fdemo9"},"content":{"rendered":"<div class=\"article_content clearfix\" id=\"article_content\">\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/kdoc_html_views-1a98987dfd.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/ck_htmledit_views-704d5b9767.css\" rel=\"stylesheet\"\/>\n<div class=\"htmledit_views atom-one-dark\" id=\"content_views\">\n<p>\n   \u7ed9\u654c\u4eba\u6dfb\u52a0\u5de1\u903b\u68c0\u6d4b\uff0c\u9047\u5230\u73a9\u5bb6\u5c31\u5f00\u67aa\u5c04\u51fb\n  <\/p>\n<\/p>\n<pre><code class=\"language-python\">import pygame\nimport sys\nimport os\nimport random\n\n# \u521d\u59cb\u5316Pygame\npygame.init()\n\n# \u5c4f\u5e55\u5bbd\u5ea6\nSCREEN_WIDTH = 1200\n# \u5c4f\u5e55\u9ad8\u5ea6\uff0c\u4e3a\u5c4f\u5e55\u5bbd\u5ea6\u76840.5\u500d\nSCREEN_HEIGHT = int(SCREEN_WIDTH * 0.5)\n\n# \u521b\u5efa\u4e00\u4e2a\u6307\u5b9a\u5c3a\u5bf8\u7684\u663e\u793a\u8868\u9762\u5bf9\u8c61\nscreen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))\n# \u8bbe\u7f6e\u7a97\u53e3\u6807\u9898\npygame.display.set_caption('\u5c04\u51fb\u6e38\u620f')\n\n# \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u65f6\u949f\u5bf9\u8c61\u6765\u8ddf\u8e2a\u65f6\u95f4\nclock = pygame.time.Clock()\n# FPS\uff08\u6bcf\u79d2\u5e27\u6570\uff09\uff1a\u5e27\u7387\u662f\u6307\u4e00\u79d2\u5185\u51fa\u73b0\u7684\u5e27\u6570\u3002\n# \u9891\u7387\uff0c\u5373\u8fde\u7eed\u56fe\u50cf\u88ab\u6355\u83b7\u6216\u663e\u793a\u7684\u9891\u7387\u3002\n# \u8bbe\u7f6e\u5e27\u7387\nFPS = 60\n\n# \u5b9a\u4e49\u6e38\u620f\u53d8\u91cf\n# \u91cd\u529b\u503c\nGRAVITY = 0.75\n# \u5730\u56fe\u7684\u884c\u6570\nROWS = 16\n# \u5730\u56fe\u7684\u5217\u6570\nCOLS = 150\n# \u6bcf\u4e2a\u56fe\u5757\u7684\u5927\u5c0f\uff0c\u901a\u8fc7\u5c4f\u5e55\u9ad8\u5ea6\u9664\u4ee5\u884c\u6570\u5f97\u5230\nTILE_SIZE = SCREEN_HEIGHT \/\/ ROWS\n\n\n# \u5b9a\u4e49\u73a9\u5bb6\u52a8\u4f5c\u53d8\u91cf\n# \u662f\u5426\u5411\u5de6\u79fb\u52a8\nmoving_left = False\n# \u662f\u5426\u5411\u53f3\u79fb\u52a8\nmoving_right = False\n# \u662f\u5426\u5c04\u51fb\nshoot = False\n# \u662f\u5426\u6295\u63b7\u624b\u96f7\ngrenade = False\n# \u624b\u96f7\u662f\u5426\u5df2\u6295\u63b7\ngrenade_thrown = False\n\n\n# \u5b50\u5f39\u56fe\u50cf\nbullet_img = pygame.image.load('img\/icons\/bullet.png').convert_alpha()\n# \u624b\u96f7\u56fe\u50cf\ngrenade_img = pygame.image.load('img\/icons\/grenade.png').convert_alpha()\n# \u751f\u547d\u7bb1\u5b50\u56fe\u50cf\nhealth_box_img = pygame.image.load('img\/icons\/health_box.png').convert_alpha()\n# \u5f39\u836f\u7bb1\u5b50\u56fe\u50cf\nammo_box_img = pygame.image.load('img\/icons\/ammo_box.png').convert_alpha()\n# \u624b\u96f7\u7bb1\u5b50\u56fe\u50cf\ngrenade_box_img = pygame.image.load('img\/icons\/grenade_box.png').convert_alpha()\n\n# \u7269\u54c1\u7bb1\u5b50\u5b57\u5178\nitem_boxes = {\n    'Health': health_box_img,\n    'Ammo': ammo_box_img,\n    'Grenade': grenade_box_img\n}\n\n# \u5b9a\u4e49\u989c\u8272\n# \u80cc\u666f\u989c\u8272\nBG = (144, 201, 120)\n# \u7ea2\u8272\nRED = (255, 0, 0)\n# \u767d\u8272\nWHITE = (255, 255, 255)\n# \u7eff\u8272\nGREEN = (0, 255, 0)\n# \u9ed1\u8272\nBLACK = (0, 0, 0)\n# \u7c89\u8272\nPINK = (235, 65, 54)\n\n# \u5b9a\u4e49\u5b57\u4f53\n# \u4f7f\u7528Futura\u5b57\u4f53\uff0c\u5b57\u53f7\u4e3a30\nfont = pygame.font.SysFont('Futura', 30)\n\ndef draw_text(text, font, text_col, x, y):\n    # \u521b\u5efa\u4e00\u4e2a\u65b0\u56fe\u50cf\uff08\u8868\u9762\uff09\uff0c\u5728\u4e0a\u9762\u6e32\u67d3\u6307\u5b9a\u7684\u6587\u672c\n    img = font.render(text, True, text_col)\n    # \u5c06\u56fe\u50cf\u7ed8\u5236\u5230\u5c4f\u5e55\u4e0a\n    screen.blit(img, (x, y))\n\ndef draw_bg():\n    # \u7528\u80cc\u666f\u989c\u8272\u586b\u5145\u5c4f\u5e55\n    screen.fill(BG)\n    pygame.draw.line(screen,RED,(0,300),(SCREEN_WIDTH,300))\n\nclass Soldier(pygame.sprite.Sprite):\n    def __init__(self,char_type, x,y,scale,speed,ammo,grenades):\n        super().__init__()\n        self.alive = True  # \u89d2\u8272\u662f\u5426\u5b58\u6d3b\n        self.char_type=char_type\n        self.speed = speed  # \u79fb\u52a8\u901f\u5ea6\n        self.ammo = ammo  # \u5f53\u524d\u5f39\u836f\u91cf\n        self.start_ammo = ammo  # \u521d\u59cb\u5f39\u836f\u91cf\n        self.shoot_cooldown = 0  # \u5c04\u51fb\u51b7\u5374\u8ba1\u6570\u5668\n        self.grenades = grenades  # \u624b\u96f7\u6570\u91cf\n        self.health = 100  # \u5f53\u524d\u751f\u547d\u503c\n        self.max_health = self.health  # \u6700\u5927\u751f\u547d\u503c\n        self.direction = 1  # \u65b9\u5411\uff081\u4e3a\u53f3\uff0c-1\u4e3a\u5de6\uff09\n        self.vel_y = 0  # \u5782\u76f4\u901f\u5ea6\n        self.jump = False  # \u8df3\u8dc3\u72b6\u6001\n        self.in_air = True  # \u662f\u5426\u5728\u7a7a\u4e2d\n        self.flip = False  # \u662f\u5426\u7ffb\u8f6c\u56fe\u50cf\uff08\u5de6\u53f3\u65b9\u5411\uff09\n        self.animation_list = []  # \u52a8\u753b\u5e27\u5217\u8868\n        self.frame_index = 0  # \u5f53\u524d\u52a8\u753b\u5e27\u7d22\u5f15\n        self.action = 0  # \u5f53\u524d\u52a8\u4f5c\uff080:\u95f2\u7f6e, 1:\u5954\u8dd1, 2:\u8df3\u8dc3, 3:\u6b7b\u4ea1\uff09\n        self.update_time = pygame.time.get_ticks()  # \u4e0a\u6b21\u66f4\u65b0\u65f6\u95f4\n\n        # \u4e13\u7528\u53d8\u91cf\n        self.move_counter = 0  # \u79fb\u52a8\u8ba1\u6570\u5668\n        self.vision = pygame.Rect(0, 0, 150, 20)  # \u89c6\u91ce\u8303\u56f4\n        self.idling = False  # \u662f\u5426\u5904\u4e8e\u95f2\u7f6e\u72b6\u6001\n        self.idling_counter = 0  # \u95f2\u7f6e\u8ba1\u65f6\u5668\n\n        \n        # \u52a0\u8f7d\u89d2\u8272\u6240\u6709\u52a8\u753b\n        animation_types = ['Idle', 'Run', 'Jump', 'Death']  # \u5b9a\u4e49\u6240\u6709\u52a8\u753b\u7c7b\u578b\n        for animation in animation_types:  # \u904d\u5386\u6bcf\u79cd\u52a8\u753b\u7c7b\u578b\n            temp_list = []  # \u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u5217\u8868\u7528\u4e8e\u5b58\u50a8\u5f53\u524d\u52a8\u753b\u7c7b\u578b\u7684\u5e27\n            # \u8ba1\u7b97\u5f53\u524d\u52a8\u753b\u7c7b\u578b\u7684\u5e27\u6570\n            num_of_frames = len(os.listdir(f'img\/{self.char_type}\/{animation}'))\n            for i in range(num_of_frames):  # \u904d\u5386\u6bcf\u5e27\n                # \u52a0\u8f7d\u5e76\u7f29\u653e\u56fe\u50cf\n                img = pygame.image.load(f'img\/{self.char_type}\/{animation}\/{i}.png').convert_alpha()\n                img = pygame.transform.scale(img, (int(img.get_width() * scale), int(img.get_height() * scale)))\n                temp_list.append(img)  # \u5c06\u5904\u7406\u540e\u7684\u56fe\u50cf\u6dfb\u52a0\u5230\u4e34\u65f6\u5217\u8868\n            self.animation_list.append(temp_list)  # \u5c06\u5f53\u524d\u52a8\u753b\u7c7b\u578b\u7684\u5168\u90e8\u5e27\u6dfb\u52a0\u5230\u52a8\u753b\u5217\u8868\n        \n        # \u8bbe\u7f6e\u521d\u59cb\u56fe\u50cf\u548c\u78b0\u649e\u77e9\u5f62\n        self.image = self.animation_list[self.action][self.frame_index]\n        self.rect = self.image.get_rect()\n        self.rect.center = (x, y)\n        self.width = self.image.get_width()\n        self.height = self.image.get_height()\n    \n    def update(self):\n        # \u66f4\u65b0\u52a8\u753b\u548c\u68c0\u67e5\u5b58\u6d3b\u72b6\u6001\n        self.update_animation()\n        self.check_alive()\n        # \u66f4\u65b0\u5c04\u51fb\u51b7\u5374\n        if self.shoot_cooldown &gt; 0:\n            self.shoot_cooldown -= 1\n\n    def move(self, moving_left, moving_right):\n            # \u521d\u59cb\u5316\u79fb\u52a8\u53d8\u91cf\n            screen_scroll = 0\n            dx = 0\n            dy = 0\n            \n            # \u5904\u7406\u6c34\u5e73\u79fb\u52a8\n            if moving_left:\n                dx = -self.speed\n                self.flip = True\n                self.direction = -1\n            if moving_right:\n                dx = self.speed\n                self.flip = False\n                self.direction = 1\n\n            # \u5904\u7406\u8df3\u8dc3\n            if self.jump and not self.in_air:\n                self.vel_y = -11\n                self.jump = False\n                self.in_air = True\n            \n            # \u5e94\u7528\u91cd\u529b\n            self.vel_y += GRAVITY\n            if self.vel_y &gt; 10:  # \u9650\u5236\u6700\u5927\u4e0b\u843d\u901f\u5ea6\n                self.vel_y=10\n            dy += self.vel_y\n\n            # \u68c0\u6d4b\u662f\u5426\u6389\u843d\u51fa\u5730\u56fe\n            if self.rect.bottom +dy&gt;300:\n                dy=300-self.rect.bottom\n                self.in_air=False\n\n            # \u66f4\u65b0\u4f4d\u7f6e\n            self.rect.x += dx\n            self.rect.y += dy\n\n    def shoot(self):\n        # \u5c04\u51fb\u903b\u8f91\uff1a\u68c0\u67e5\u51b7\u5374\u548c\u5f39\u836f\n        if self.shoot_cooldown == 0 and self.ammo &gt; 0:\n            self.shoot_cooldown = 20  # \u8bbe\u7f6e\u51b7\u5374\u65f6\u95f4\n            # \u521b\u5efa\u5b50\u5f39\u5bf9\u8c61\uff08\u4ece\u89d2\u8272\u4e2d\u5fc3\u524d\u65b9\u53d1\u5c04\uff09\n            bullet = Bullet(self.rect.centerx + (0.75 * self.rect.size[0] * self.direction), \n                            self.rect.centery, self.direction)\n            bullet_group.add(bullet)\n            self.ammo -= 1  # \u6d88\u8017\u5f39\u836f\n\n    def ai(self):\n        # AI\u884c\u4e3a\u903b\u8f91\n        if self.alive and player.alive:\n            # \u968f\u673a\u8fdb\u5165\u95f2\u7f6e\u72b6\u6001\n            if not self.idling and random.randint(1, 50) == 1:\n                self.update_action(0)  # 0: \u95f2\u7f6e\n                self.idling = True\n                self.idling_counter = 50\n            \n            # \u68c0\u6d4b\u662f\u5426\u770b\u5230\u73a9\u5bb6\n            if self.vision.colliderect(player.rect):\n                self.update_action(0)  # \u505c\u6b62\u79fb\u52a8\uff0c\u8f6c\u4e3a\u95f2\u7f6e\n                self.shoot()  # \u5411\u73a9\u5bb6\u5c04\u51fb\n            else:\n                if not self.idling:\n                    # \u5de6\u53f3\u79fb\u52a8\u903b\u8f91\n                    ai_moving_right = self.direction == 1\n                    ai_moving_left = not ai_moving_right\n                    self.move(ai_moving_left, ai_moving_right)\n                    self.update_action(1)  # 1: \u5954\u8dd1\n                    \n                    # \u66f4\u65b0\u89c6\u91ce\u8303\u56f4\n                    self.move_counter += 1\n                    self.vision.center = (self.rect.centerx + 75 * self.direction, self.rect.centery)\n                    \n                    # \u5230\u8fbe\u8fb9\u754c\u540e\u8f6c\u5411\n                    if self.move_counter &gt; TILE_SIZE:\n                        self.direction *= -1\n                        self.move_counter = 0\n                else:\n                    # \u95f2\u7f6e\u8ba1\u65f6\u5668\u9012\u51cf\n                    self.idling_counter -= 1\n                    if self.idling_counter &lt;= 0:\n                        self.idling = False\n\n    def update_animation(self):\n        # \u52a8\u753b\u66f4\u65b0\u903b\u8f91\n        ANIMATION_COOLDOWN = 100  # \u52a8\u753b\u5e27\u95f4\u9694\uff08\u6beb\u79d2\uff09\n        \n        # \u66f4\u65b0\u5f53\u524d\u5e27\n        self.image = self.animation_list[self.action][self.frame_index]\n        \n        # \u68c0\u67e5\u662f\u5426\u9700\u8981\u66f4\u65b0\u5e27\n        if pygame.time.get_ticks() - self.update_time &gt; ANIMATION_COOLDOWN:\n            self.update_time = pygame.time.get_ticks()\n            self.frame_index += 1\n            \n            # \u68c0\u67e5\u662f\u5426\u9700\u8981\u91cd\u7f6e\u52a8\u753b\n            if self.frame_index &gt;= len(self.animation_list[self.action]):\n                if self.action == 3:  # \u6b7b\u4ea1\u52a8\u753b\u505c\u5728\u6700\u540e\u4e00\u5e27\n                    self.frame_index = len(self.animation_list[self.action]) - 1\n                else:\n                    self.frame_index = 0\n    \n    def update_action(self, new_action):\n        # \u5207\u6362\u52a8\u4f5c\u72b6\u6001\n        if new_action != self.action:\n            self.action = new_action\n            # \u91cd\u7f6e\u52a8\u753b\u5e27\n            self.frame_index = 0\n            self.update_time = pygame.time.get_ticks()\n    \n    def check_alive(self):\n        # \u68c0\u67e5\u662f\u5426\u5b58\u6d3b\n        if self.health &lt;= 0:\n            self.health = 0\n            self.speed = 0\n            self.alive = False\n            self.update_action(3)  # 3: \u6b7b\u4ea1\u52a8\u753b\n        \n    def draw(self):\n    # \u7ed8\u5236\u89d2\u8272\u5230\u5c4f\u5e55\n        flipped_image = pygame.transform.flip(self.image, self.flip, False)\n        screen.blit(flipped_image, self.rect)\n\nclass ItemBox(pygame.sprite.Sprite):\n    def __init__(self, item_type, x, y):\n        pygame.sprite.Sprite.__init__(self)\n        self.item_type = item_type\n        self.image = item_boxes[self.item_type]\n        self.rect = self.image.get_rect()\n        self.rect.midtop = (x + TILE_SIZE \/\/ 2, y + (TILE_SIZE - self.image.get_height()))\n\n    def update(self):\n        # \u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u6361\u8d77\u4e86\u7bb1\u5b50\n        if pygame.sprite.collide_rect(self, player):\n            # \u68c0\u67e5\u662f\u54ea\u79cd\u7bb1\u5b50\n            if self.item_type == 'Health':\n                player.health += 25\n                if player.health &gt; player.max_health:\n                    player.health = player.max_health\n            elif self.item_type == 'Ammo':\n                player.ammo += 15\n            elif self.item_type == 'Grenade':\n                player.grenades += 3\n            # \u5220\u9664\u7269\u54c1\u7bb1\n            self.kill()\n\nclass HealthBar():\n    def __init__(self, x, y, health, max_health):\n        self.x = x\n        self.y = y\n        self.health = health\n        self.max_health = max_health\n\n    def draw(self, health):\n        # \u66f4\u65b0\u5f53\u524d\u751f\u547d\u503c\n        self.health = health\n        # \u8ba1\u7b97\u751f\u547d\u503c\u6bd4\u4f8b\n        ratio = self.health \/ self.max_health\n        pygame.draw.rect(screen, BLACK, (self.x - 2, self.y - 2, 154, 24))\n        pygame.draw.rect(screen, RED, (self.x, self.y, 150, 20))\n        pygame.draw.rect(screen, GREEN, (self.x, self.y, 150 * ratio, 20))\n\nclass Bullet(pygame.sprite.Sprite):\n    def __init__(self, x, y, direction):\n        # \u521d\u59cb\u5316\u5b50\u5f39\u7cbe\u7075\n        pygame.sprite.Sprite.__init__(self)\n        self.speed = 10  # \u5b50\u5f39\u79fb\u52a8\u901f\u5ea6\n        self.image = bullet_img  # \u5b50\u5f39\u56fe\u50cf\n        self.rect = self.image.get_rect()  # \u83b7\u53d6\u56fe\u50cf\u77e9\u5f62\u533a\u57df\n        self.rect.center = (x, y)  # \u8bbe\u7f6e\u5b50\u5f39\u521d\u59cb\u4f4d\u7f6e\n        self.direction = direction  # \u5b50\u5f39\u65b9\u5411\uff081\u4e3a\u53f3\uff0c-1\u4e3a\u5de6\uff09\n\n    def update(self):\n        # \u79fb\u52a8\u5b50\u5f39\n        self.rect.x += (self.direction * self.speed) \n\n        # \u68c0\u67e5\u5b50\u5f39\u662f\u5426\u8d85\u51fa\u5c4f\u5e55\u8fb9\u754c\n        if self.rect.right &lt; 0 or self.rect.left &gt; SCREEN_WIDTH:\n            self.kill()  # \u8d85\u51fa\u5c4f\u5e55\u5219\u9500\u6bc1\u5b50\u5f39    \n        # \u68c0\u67e5\u5b50\u5f39\u4e0e\u73a9\u5bb6\u7684\u78b0\u649e\n        if pygame.sprite.spritecollide(player, bullet_group, False):\n            if player.alive:\n                player.health -= 5  # \u73a9\u5bb6\u53d7\u4f24\n                self.kill()  # \u9500\u6bc1\u5b50\u5f39\n\n        for enemy in enemy_group:        \n            if pygame.sprite.spritecollide(enemy, bullet_group, False):\n                if enemy.alive:\n                    enemy.health -= 25  # \u654c\u4eba\u53d7\u4f24\n                    self.kill()  # \u9500\u6bc1\u5b50\u5f39\n\nclass Grenade(pygame.sprite.Sprite):\n    def __init__(self, x, y, direction):\n        # \u521d\u59cb\u5316\u624b\u96f7\u7cbe\u7075\n        pygame.sprite.Sprite.__init__(self)\n        self.timer = 100  # \u624b\u96f7\u7206\u70b8\u8ba1\u65f6\u5668\n        self.vel_y = -11  # \u624b\u96f7\u5782\u76f4\u521d\u901f\u5ea6\uff08\u7528\u4e8e\u629b\u5c04\u6548\u679c\uff09\n        self.speed = 7  # \u624b\u96f7\u6c34\u5e73\u79fb\u52a8\u901f\u5ea6\n        self.image = grenade_img  # \u624b\u96f7\u56fe\u50cf\n        self.rect = self.image.get_rect()  # \u83b7\u53d6\u56fe\u50cf\u77e9\u5f62\u533a\u57df\n        self.rect.center = (x, y)  # \u8bbe\u7f6e\u624b\u96f7\u521d\u59cb\u4f4d\u7f6e\n        self.width = self.image.get_width()  # \u624b\u96f7\u5bbd\u5ea6\n        self.height = self.image.get_height()  # \u624b\u96f7\u9ad8\u5ea6\n        self.direction = direction  # \u624b\u96f7\u6295\u63b7\u65b9\u5411\uff081\u4e3a\u53f3\uff0c-1\u4e3a\u5de6\uff09\n\n    def update(self):\n        # \u5e94\u7528\u91cd\u529b\u5f71\u54cd\u624b\u96f7\u5782\u76f4\u8fd0\u52a8\n        self.vel_y += GRAVITY\n        dx = self.direction * self.speed  # \u6c34\u5e73\u79fb\u52a8\u8ddd\u79bb\n        dy = self.vel_y  # \u5782\u76f4\u79fb\u52a8\u8ddd\u79bb\n\n        if self.rect.bottom +dy &gt;300:\n            dy =300 - self.rect.bottom\n            self.speed=0\n        if self.rect.left +dx &lt;0 or self.rect.right +dx&gt;SCREEN_WIDTH :\n            self.direction *=-1\n\n        # \u66f4\u65b0\u624b\u96f7\u4f4d\u7f6e\n        self.rect.x += dx\n        self.rect.y += dy\n\n        # \u624b\u96f7\u8ba1\u65f6\u5668\u5012\u8ba1\u65f6\n        self.timer -= 1\n        if self.timer &lt;= 0:\n            self.kill()  # \u9500\u6bc1\u624b\u96f7\n            \n            # \u521b\u5efa\u7206\u70b8\u6548\u679c\n            explosion = Explosion(self.rect.x, self.rect.y, 0.8)\n            explosion_group.add(explosion)\n            \n            # \u5bf9\u624b\u96f7\u4e00\u5b9a\u8303\u56f4\u5185\u7684\u89d2\u8272\u9020\u6210\u4f24\u5bb3\n            if abs(self.rect.centerx - player.rect.centerx) &lt; TILE_SIZE * 2 and \\\n               abs(self.rect.centery - player.rect.centery) &lt; TILE_SIZE * 2:\n                player.health -= 50  # \u73a9\u5bb6\u53d7\u4f24\n                \n            # \u5bf9\u654c\u4eba\u9020\u6210\u4f24\u5bb3\n            for enemy in enemy_group:\n                if abs(self.rect.centerx - enemy.rect.centerx) &lt; TILE_SIZE * 2 and \\\n                   abs(self.rect.centery - enemy.rect.centery) &lt; TILE_SIZE * 2:\n                    enemy.health -= 50  # \u654c\u4eba\u53d7\u4f24\n\nclass Explosion(pygame.sprite.Sprite):\n    def __init__(self, x, y, scale):\n        pygame.sprite.Sprite.__init__(self)\n        self.images = []\n        # \u52a0\u8f7d\u7206\u70b8\u52a8\u753b\u76845\u5e27\u56fe\u50cf\n        for num in range(1, 6):\n            img = pygame.image.load(f'img\/explosion\/exp{num}.png').convert_alpha()\n            img = pygame.transform.scale(img, (int(img.get_width() * scale), int(img.get_height() * scale)))\n            self.images.append(img)\n        self.frame_index = 0  # \u5f53\u524d\u52a8\u753b\u5e27\u7d22\u5f15\n        self.image = self.images[self.frame_index]  # \u5f53\u524d\u663e\u793a\u7684\u56fe\u50cf\n        self.rect = self.image.get_rect()  # \u83b7\u53d6\u56fe\u50cf\u7684\u77e9\u5f62\u533a\u57df\n        self.rect.center = (x, y)  # \u8bbe\u7f6e\u7206\u70b8\u4f4d\u7f6e\n        self.counter = 0  # \u5e27\u8ba1\u6570\u5668\n\n    def update(self):\n        \n        EXPLOSION_SPEED = 4  # \u7206\u70b8\u52a8\u753b\u901f\u5ea6\uff08\u6570\u503c\u8d8a\u5c0f\u901f\u5ea6\u8d8a\u5feb\uff09\n        \n        # \u66f4\u65b0\u7206\u70b8\u52a8\u753b\n        self.counter += 1\n        if self.counter &gt;= EXPLOSION_SPEED:\n            self.counter = 0\n            self.frame_index += 1\n            # \u5982\u679c\u52a8\u753b\u64ad\u653e\u5b8c\u6bd5\uff0c\u5219\u5220\u9664\u7206\u70b8\u6548\u679c\n            if self.frame_index &gt;= len(self.images):\n                self.kill()\n            else:\n                self.image = self.images[self.frame_index]\n\n# \u521b\u5efa\u7cbe\u7075\u7ec4\nenemy_group = pygame.sprite.Group()  # \u654c\u4eba\u7fa4\u7ec4\nbullet_group = pygame.sprite.Group()  # \u5b50\u5f39\u7fa4\u7ec4\ngrenade_group = pygame.sprite.Group()  # \u624b\u96f7\u7fa4\u7ec4\nexplosion_group = pygame.sprite.Group()  # \u7206\u70b8\u6548\u679c\u7fa4\u7ec4\nitem_box_group = pygame.sprite.Group()  # \u7269\u54c1\u7bb1\u5b50\u7fa4\u7ec4\n\nitem_box=ItemBox(\"Health\",100,260)\nitem_box_group.add(item_box)\nitem_box=ItemBox(\"Ammo\",400,260)\nitem_box_group.add(item_box)\nitem_box=ItemBox(\"Grenade\",500,260)\nitem_box_group.add(item_box)\n\nplayer =Soldier(\"player\",200,200,1.65,5,10,5)\nhealth_bar=HealthBar(10,10,player.health,player.health)\nenemy =Soldier(\"enemy\",400,270,1.65,5,30,0)\nenemy1 =Soldier(\"enemy\",600,270,1.65,5,30,0)\nenemy_group.add(enemy)\nenemy_group.add(enemy1)\n\nrun = True\nwhile run:  # \u6e38\u620f\u4e3b\u5faa\u73af\n    clock.tick(FPS)  # \u8bbe\u7f6e\u5e27\u7387\n    draw_bg()\n\n    # \u663e\u793a\u73a9\u5bb6\u751f\u547d\u503c\n    health_bar.draw(player.health) \n    # \u663e\u793a\u5f39\u836f\u6570\u91cf\n    draw_text('AMMO: ', font, WHITE, 10, 35)\n    for x in range(player.ammo):\n        screen.blit(bullet_img, (90 + (x * 10), 40))\n    # \u663e\u793a\u624b\u96f7\u6570\u91cf\n    draw_text('GRENADES: ', font, WHITE, 10, 60)\n    for x in range(player.grenades):\n        screen.blit(grenade_img, (135 + (x * 15), 60))\n\n    player.update()\n    player.draw()\n    for enemy in enemy_group:\n            enemy.ai()\n            enemy.update()  # \u66f4\u65b0\u654c\u4eba\u72b6\u6001\n            enemy.draw()  # \u7ed8\u5236\u654c\u4eba\n\n    bullet_group.update()\n    bullet_group.draw(screen)\n    grenade_group.update()\n    grenade_group.draw(screen)\n    explosion_group.update()\n    explosion_group.draw(screen)\n    item_box_group.update()\n    item_box_group.draw(screen)\n    \n    # \u66f4\u65b0\u73a9\u5bb6\u52a8\u4f5c\n    if player.alive:\n        # \u5c04\u51fb\u5b50\u5f39\n        if shoot:\n            player.shoot()\n        # \u6295\u63b7\u624b\u96f7\n        elif grenade and grenade_thrown == False and player.grenades &gt; 0:\n            grenade = Grenade(player.rect.centerx + (0.5 * player.rect.size[0] * player.direction),\n                                player.rect.top, player.direction)\n            grenade_group.add(grenade)\n            # \u51cf\u5c11\u624b\u96f7\u6570\u91cf\n            player.grenades -= 1\n            grenade_thrown = True\n\n        if player.in_air:\n            player.update_action(2)  # 2: \u8df3\u8dc3\u52a8\u4f5c\n        elif moving_left or moving_right:\n            player.update_action(1)  # 1: \u5954\u8dd1\u52a8\u4f5c\n        else:\n            player.update_action(0)  # 0: \u95f2\u7f6e\u52a8\u4f5c\n\n        player.move(moving_left, moving_right)  # \u79fb\u52a8\u73a9\u5bb6\n    \n\n    for event in pygame.event.get():\n        # \u5904\u7406\u9000\u51fa\u6e38\u620f\u4e8b\u4ef6\n        if event.type == pygame.QUIT:\n                run = False\n                sys.exit()\n        # \u5904\u7406\u952e\u76d8\u6309\u4e0b\u4e8b\u4ef6\n        if event.type == pygame.KEYDOWN:\n            if event.key == pygame.K_a or event.key == pygame.K_LEFT:  # \u6309\u4e0bA\u952e\u6216\u5de6\u952e =&gt; \u5411\u5de6\u79fb\u52a8\n                moving_left = True\n            if event.key == pygame.K_d or event.key == pygame.K_RIGHT:  # \u6309\u4e0bD\u952e\u6216\u53f3\u952e =&gt; \u5411\u53f3\u79fb\u52a8\n                moving_right = True\n            if event.key == pygame.K_SPACE:  # \u6309\u4e0b\u7a7a\u683c\u952e =&gt; \u5c04\u51fb\n                shoot = True\n            if event.key == pygame.K_q or event.key == pygame.K_g:  # \u6309\u4e0bQ\u952e\u6216G\u952e =&gt; \u6295\u63b7\u624b\u96f7\n                grenade = True\n            if (event.key == pygame.K_w or event.key == pygame.K_UP) and player.alive:  # \u6309\u4e0bW\u952e\u6216\u4e0a\u952e\u4e14\u73a9\u5bb6\u5b58\u6d3b =&gt; \u8df3\u8dc3\n                player.jump = True\n            if event.key == pygame.K_ESCAPE:  # \u6309\u4e0bESC\u952e =&gt; \u5173\u95ed\u7a97\u53e3\n                run = False\n\n        # \u5904\u7406\u952e\u76d8\u91ca\u653e\u4e8b\u4ef6\n        if event.type == pygame.KEYUP:\n            if event.key == pygame.K_a or event.key == pygame.K_LEFT:\n                moving_left = False\n            if event.key == pygame.K_d or event.key == pygame.K_RIGHT:\n                moving_right = False\n            if event.key == pygame.K_SPACE:\n                shoot = False\n            if event.key == pygame.K_q or event.key == pygame.K_g:\n                grenade = False\n                grenade_thrown = False\n\n\n    pygame.display.update()  # \u66f4\u65b0\u5c4f\u5e55\u663e\u793a<\/code><\/pre>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed9\u654c\u4eba\u6dfb\u52a0\u5de1\u903b\u68c0\u6d4b\uff0c\u9047\u5230\u73a9\u5bb6\u5c31\u5f00\u67aa\u5c04\u51fb import pygame import sys import os  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-2616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-23"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5c04\u51fb\u6e38\u620fdemo9 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/\u5c04\u51fb\u6e38\u620fdemo9\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5c04\u51fb\u6e38\u620fdemo9 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"og:description\" content=\"\u7ed9\u654c\u4eba\u6dfb\u52a0\u5de1\u903b\u68c0\u6d4b\uff0c\u9047\u5230\u73a9\u5bb6\u5c31\u5f00\u67aa\u5c04\u51fb import pygame import sys import os [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/\u5c04\u51fb\u6e38\u620fdemo9\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-22T10:00:21+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"260\" \/>\n\t<meta property=\"og:image:height\" content=\"180\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin@wunen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin@wunen\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/\"},\"author\":{\"name\":\"admin@wunen\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\"},\"headline\":\"\u5c04\u51fb\u6e38\u620fdemo9\",\"datePublished\":\"2025-05-22T10:00:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/\"},\"wordCount\":1,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.wunen.com\/#organization\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"articleSection\":[\"\u5c04\u51fb\u6e38\u620f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/\",\"url\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/\",\"name\":\"\u5c04\u51fb\u6e38\u620fdemo9 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"datePublished\":\"2025-05-22T10:00:21+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"width\":260,\"height\":180},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.wunen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c04\u51fb\u6e38\u620fdemo9\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.wunen.com\/#website\",\"url\":\"http:\/\/www.wunen.com\/\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"description\":\"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9\",\"publisher\":{\"@id\":\"http:\/\/www.wunen.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.wunen.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/www.wunen.com\/#organization\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"url\":\"http:\/\/www.wunen.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"width\":1024,\"height\":1024,\"caption\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\",\"name\":\"admin@wunen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"caption\":\"admin@wunen\"},\"sameAs\":[\"http:\/\/www.wunen.com\"],\"url\":\"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5c04\u51fb\u6e38\u620fdemo9 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/\u5c04\u51fb\u6e38\u620fdemo9\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5c04\u51fb\u6e38\u620fdemo9 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","og_description":"\u7ed9\u654c\u4eba\u6dfb\u52a0\u5de1\u903b\u68c0\u6d4b\uff0c\u9047\u5230\u73a9\u5bb6\u5c31\u5f00\u67aa\u5c04\u51fb import pygame import sys import os [&hellip;]","og_url":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/\u5c04\u51fb\u6e38\u620fdemo9\/","og_site_name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","article_published_time":"2025-05-22T10:00:21+00:00","og_image":[{"width":260,"height":180,"url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","type":"image\/jpeg"}],"author":"admin@wunen","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin@wunen","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#article","isPartOf":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/"},"author":{"name":"admin@wunen","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8"},"headline":"\u5c04\u51fb\u6e38\u620fdemo9","datePublished":"2025-05-22T10:00:21+00:00","mainEntityOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/"},"wordCount":1,"commentCount":0,"publisher":{"@id":"http:\/\/www.wunen.com\/#organization"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","articleSection":["\u5c04\u51fb\u6e38\u620f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/","url":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/","name":"\u5c04\u51fb\u6e38\u620fdemo9 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","isPartOf":{"@id":"http:\/\/www.wunen.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","datePublished":"2025-05-22T10:00:21+00:00","breadcrumb":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#primaryimage","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","width":260,"height":180},{"@type":"BreadcrumbList","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/22\/%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8fdemo9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.wunen.com\/"},{"@type":"ListItem","position":2,"name":"\u5c04\u51fb\u6e38\u620fdemo9"}]},{"@type":"WebSite","@id":"http:\/\/www.wunen.com\/#website","url":"http:\/\/www.wunen.com\/","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","description":"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9","publisher":{"@id":"http:\/\/www.wunen.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.wunen.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"http:\/\/www.wunen.com\/#organization","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","url":"http:\/\/www.wunen.com\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","width":1024,"height":1024,"caption":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51"},"image":{"@id":"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8","name":"admin@wunen","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","caption":"admin@wunen"},"sameAs":["http:\/\/www.wunen.com"],"url":"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/"}]}},"_links":{"self":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/2616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/comments?post=2616"}],"version-history":[{"count":0,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/2616\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media?parent=2616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/categories?post=2616"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/tags?post=2616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}