Пример #1
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))
leftWall.image.fill((0,255,0))

rightWall = WorldSprite(world.size[0]-32, 32, 32, world.size[1]-64)
rightWall.image = pygame.Surface((rightWall.rect.width, rightWall.rect.height))
rightWall.image.fill((0,255,0))

world.background = [floor, leftWall, rightWall, roof, wall]
world.clip = [floor, leftWall, rightWall, roof, wall]
world.players = [player]
world.crates = [crate]
world.gravity = 2
world.mobSpawns = [[100, 100]]

for i in world.drawList:
    for e in i:
        print i.size, i.position

enemySpawn = 0
while 1:
    world.buildDrawList()
    world.buildEntList()
    
    screen.fill((255,255,255))
    world.draw(screen)