本文整理汇总了Python中World.World.size方法的典型用法代码示例。如果您正苦于以下问题:Python World.size方法的具体用法?Python World.size怎么用?Python World.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World.World
的用法示例。
在下文中一共展示了World.size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Crate
# 需要导入模块: from World import World [as 别名]
# 或者: from World.World import size [as 别名]
enemy.image = pygame.Surface((32,32))
enemy.image.fill((255,0,0))
enemy.rect.size = (32,32)
enemy.prevRect.size = enemy.rect.size
enemy.health = 5
crate = Crate()
crate.rect.topleft = [500, 200]
crate.image = pygame.Surface((24,24))
crate.image.fill((255,150,50))
crate.rect.size = (24,24)
font = pygame.font.Font(None, 32)
world = World()
world.size = (800,600)
floor = WorldSprite(0, world.size[1]-32, world.size[0], 32)
floor.image = pygame.Surface((floor.rect.width, floor.rect.height))
floor.image.fill((0,255,0))
roof = WorldSprite(0, 0, world.size[0], 32)
roof.image = pygame.Surface((roof.rect.width, roof.rect.height))
roof.image.fill((0,255,0))
wall = WorldSprite(64, 450, 300, 32)
wall.image = pygame.Surface((wall.rect.width, wall.rect.height))
wall.image.fill((0,255,0))
leftWall = WorldSprite(0, 32, 32, world.size[1]-64)
leftWall.image = pygame.Surface((leftWall.rect.width, leftWall.rect.height))