From 43a1364cd0333976912910f084d013734fcbb316 Mon Sep 17 00:00:00 2001 From: Fran Rogers Date: Tue, 02 Feb 2010 23:26:17 +0000 Subject: Remove old vestiges of OLPCGames --- diff --git a/blocku.py b/blocku.py index 058eb93..abe122c 100644 --- a/blocku.py +++ b/blocku.py @@ -3,18 +3,25 @@ import pygame #import gtk class Block: - pass + def __init__(self, north=None, east=None, south=None, west=None): + self.north = north + self.east = east + self.south = south + self.west = west class Puzzle: - def __init__(self, width, height, rule, edges, blocks=None): - self.width = width - self.height = height + def __init__(self, rule): self.rule = rule - self.edges = edges - self.blocks = blocks or [] + self.blocks = {} - def add_block(self, block): - self.blocks.push(block) + def add_block(self, block, coords): + self.blocks[coords] = block + + def get_blocks(self): + return self.blocks + + def shuffle(self): + pass class Game: def __init__(self): diff --git a/run.py b/run.py deleted file mode 100644 index a7a77f4..0000000 --- a/run.py +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env python -"""Skeleton project file mainloop for new OLPCGames users""" -import olpcgames, pygame, logging -from olpcgames import pausescreen - -log = logging.getLogger( 'blocku run' ) -log.setLevel( logging.DEBUG ) - -def main(): - """The mainloop which is specified in the activity.py file - - "main" is the assumed function name - """ - size = (800,600) - if olpcgames.ACTIVITY: - size = olpcgames.ACTIVITY.game_size - screen = pygame.display.set_mode(size) - - clock = pygame.time.Clock() - - running = True - while running: - screen.fill( (0,0,128)) - milliseconds = clock.tick(25) # maximum number of frames per second - - # Event-management loop with support for pausing after X seconds (20 here) - events = pausescreen.get_events() - # Now the main event-processing loop - if events: - for event in events: - log.debug( "Event: %s", event ) - if event.type == pygame.QUIT: - running = False - elif event.type == pygame.KEYDOWN: - if event.key == pygame.K_ESCAPE: - running = False - pygame.display.flip() - -if __name__ == "__main__": - logging.basicConfig() - main() -- cgit v0.9.1