Source

pygamegsoc12 / alchemymadness / main.py

Full commit

import pygame
from pygame.locals import *

import potion

SCREEN_SIZE = (640, 480)


def main():
    """ your app starts here
    """

    pygame.init()
    screen = pygame.display.set_mode(SCREEN_SIZE)
    clock = pygame.time.Clock()
    going = True

    screen.fill((0,0,0))
    background = pygame.surface.Surface(SCREEN_SIZE)

    # Tetris area
    pygame.draw.rect(background, (0,0,255),
                     (10, 10, SCREEN_SIZE[0]*.4, SCREEN_SIZE[1]*.7), 1)

    screen.blit(background, (0,0))
    pygame.display.flip()

    # Initialise level
    potion.set_formula(10, 20, 30)

    while going:
        time = clock.tick(30)
        events = pygame.event.get()
        for e in events:
            if e.type == QUIT or e.type == KEYDOWN and e.key == K_ESCAPE:
                going = False

        screen.blit(background, (0,0))
        rects = []
        pygame.display.update(rects)

    # End game
    score = potion.get_score()

    pygame.quit()