Esempio n. 1
0
 def render_block(self, block, pos, screen, viewport):
     """#fast render water
     if block["name"] == "water":
         screen.blit(World.block_images[block["id"]],
                     Convert.world_to_viewport([Convert.chunk_to_world(pos[0], self), pos[1]], viewport))"""
     #don't render air
     if block["name"] != "air":
         #print(block["name"] + " " + str(block["id"]))
         Game.get_world().render_block(block["id"], [Convert.chunk_to_world(pos[0], self), pos[1]], block["connectedTexture"], screen, viewport)
     if Game.DEBUG:
         #draw bounding box
         pygame.draw.rect(screen, Game.BLACK, pygame.Rect(Convert.chunk_to_viewport(pos, self, viewport), (Game.BLOCK_SIZE * Game.SCALE, Game.BLOCK_SIZE * Game.SCALE)), 1)