import sys import colset import io from gui import GUI from model import PixelModel fpsClock = pygame.time.Clock() pygame.init() screen = pygame.display.set_mode((800, 600)) pygame.display.set_caption('tsar-bomba - Model Maker') pygame.mouse.set_visible(1) running = True playAnim = False speed = 0 colors = colset.colorList() currentColor = (255,0,0) colorHistory = [] frameIndex = 0 speedTicks = [1,3,6,10,30] filename, model = io.loadFile(sys.argv) speed = model.speed print "Using: %s" % filename gui = GUI(screen) # all static parts of the GUI is drawn gui.drawColor(currentColor) gui.drawFrame(model.frame(frameIndex).grid) while running:
def drawColorGrid(self): for x, row in enumerate(colset.colorList()): for y, color in enumerate(row): pygame.draw.rect(self.colorgrid, color, (y*12, x*12, 12, 12))