Source

pygamegsoc12 / alchemymadness / layout.py

from pygame.locals import Rect

__all__ = ('screen_size', 'Main')

screen_size = (800, 600)

class Main(object):
    block_rect = Rect(0, 0, 30, 30)
    small_block_rect = Rect(0, 0, 15, 15)
    grid_size = Rect(0, 0, 9, 16) # size in blocks
    grid_rects = (
        Rect(30, 20, block_rect.w * grid_size[0], block_rect.h * grid_size[1]),
        Rect(300, 20, small_block_rect.w * grid_size[0], small_block_rect.h * grid_size[1]),
        Rect(470, 20, small_block_rect.w * grid_size[0], small_block_rect.h * grid_size[1]),
        Rect(630, 20, small_block_rect.w * grid_size[0], small_block_rect.h * grid_size[1]),
    )
    potion_rect = Rect(450, 470, 170, 113)