📜  玩家在水面上行走 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:16.678000             🧑  作者: Mango

代码示例1
def gravity_check(self):
      hits = pygame.sprite.spritecollide(player ,ground_group, False)
      if self.vel.y > 0:
          if hits:
              lowest = hits[0]
              if self.pos.y < lowest.rect.bottom:
                  self.pos.y = lowest.rect.top + 1
                  self.vel.y = 0
                  self.jumping = False