#! /usr/bin/python
# -*- coding: utf-8 -*-

import pygame
from pygame import *

WIN_WIDTH = 800
WIN_HEIGHT = 640
DISPLAY = (WIN_WIDTH, WIN_HEIGHT)
BACKGROUND_COLOR = '#004400'
PLATFORM_WIDTH = 32
PLATFORM_HEIGHT = 32
PLATFORM_COLOR = '#FF6262'

def main():
    pygame.init()
    screen = pygame.display.set_mode(DISPLAY)
    pygame.display.set_caption('Game02')
    bg = Surface((WIN_WIDTH,WIN_HEIGHT))
    
    bg.fill(Color(BACKGROUND_COLOR))
    level = [
       "-------------------------",
       "-                       -",
       "-                       -",
       "-                       -",
       "-            --         -",
       "-                       -",
       "--                      -",
       "-                       -",
       "-                   --- -",
       "-                       -",
       "-                       -",
       "-      ---              -",
       "-                       -",
       "-   -----------        -",
       "-                       -",
       "-                -      -",
       "-                   --  -",
       "-                       -",
       "-                       -",
       "-------------------------"]
    
    while 1:
        
        x=y=0
        for row in level:
            for col in row:
                if col == '+':
                    pf = Surface((PLATFORM_WIDTH, PLATFORM_HEIGHT))
                    pf.fill(Color(PLATFORM_COLOR))
                    screen.blit(pf,(x, y))
                x += PLATFORM_WIDTH
            y += PLATFORM_HEIGHT
            x = 0
        for e in pygame.event.get():
            if e.type == QUIT:
                raise SystemExit, 'QUIT'
        screen.blit(bg, (0, 0))
        pygame.display.update()
if __name__ == '__main__':
    main()