Commits

Anonymous committed c175090

Work on more pygame support.

  • Participants
  • Parent commits 284ff6c

Comments (0)

Files changed (12)

File examples/pygamewrapper/animating_snow.py

+# Sample Python/Pygame Programs
+# Simpson College Computer Science
+# http://programarcadegames.com/
+# http://simpson.edu/computer-science/
+
+# Explanation video: http://youtu.be/Gkhz3FuhGoI
+
+# Import a library of functions called 'pygame'
+import pygamewrapper as pygame
+import random
+
+# Initialize the game engine
+pygame.init()
+
+black = [ 0, 0, 0]
+white = [255,255,255]
+
+# Set the height and width of the screen
+size = [400,400]
+screen = pygame.display.set_mode(size)
+pygame.display.set_caption("Snow Animation")
+
+# Create an empty array
+star_list = []
+
+# Loop 50 times and add a star in a random x,y position
+for i in range(50):
+    x = random.randrange(0,400)
+    y = random.randrange(0,400)
+    star_list.append([x,y])
+
+clock = pygame.time.Clock()
+
+#Loop until the user clicks the close button.
+done = False
+while done == False:
+
+    for event in pygame.event.get(): # User did something
+        if event.type == pygame.QUIT: # If user clicked close
+            done=True # Flag that we are done so we exit this loop
+
+    # Set the screen background
+    screen.fill(black)
+
+    # Process each star in the list
+    for i in range(len(star_list)):
+    
+        # Draw the star
+        pygame.draw.circle(screen, white, star_list[i], 2)
+        
+        # Move the star down one pixel
+        star_list[i][1] += 1
+        
+        # If the star has moved off the bottom of the screen
+        if star_list[i][1] > 400:
+            # Reset it just above the top
+            y=random.randrange(-50, -10)
+            star_list[i][1] = y
+            # Give it a new x position
+            x=random.randrange(0, 400)
+            star_list[i][0] = x
+            
+    # Go ahead and update the screen with what we've drawn.
+    pygame.display.flip()
+    clock.tick(20)
+            
+# Be IDLE friendly. If you forget this line, the program will 'hang'
+# on exit.
+pygame.quit ()
+

File examples/pygamewrapper/array_backed_grid.py

+# Sample Python/Pygame Programs
+# Simpson College Computer Science
+# http://programarcadegames.com/
+# http://simpson.edu/computer-science/
+
+import pygamewrapper as pygame
+
+# Define some colors
+black    = (   0,   0,   0)
+white    = ( 255, 255, 255)
+green    = (   0, 255,   0)
+red      = ( 255,   0,   0)
+
+# This sets the width and height of each grid location
+width=20
+height=20
+
+# This sets the margin between each cell
+margin=5
+
+# Create a 2 dimensional array. A two dimesional
+# array is simply a list of lists.
+grid=[]
+for row in range(10):
+    # Add an empty array that will hold each cell
+    # in this row
+    grid.append([])
+    for column in range(10):
+        grid[row].append(0) # Append a cell
+
+# Set row 1, cell 5 to one. (Remember rows and
+# column numbers start at zero.)
+grid[1][5] = 1
+
+# Initialize pygame
+pygame.init()
+ 
+# Set the height and width of the screen
+size=[255,255]
+screen=pygame.display.set_mode(size)
+
+# Set title of screen
+pygame.display.set_caption("My Game")
+
+#Loop until the user clicks the close button.
+done=False
+
+# Used to manage how fast the screen updates
+clock=pygame.time.Clock()
+
+# -------- Main Program Loop -----------
+while done==False:
+    for event in pygame.event.get(): # User did something
+        if event.type == pygame.QUIT: # If user clicked close
+            done=True # Flag that we are done so we exit this loop
+        if event.type == pygame.MOUSEBUTTONDOWN:
+            # User clicks the mouse. Get the position
+            pos = pygame.mouse.get_pos()
+            # Change the x/y screen coordinates to grid coordinates
+            column=pos[0] // (width+margin)
+            row=pos[1] // (height+margin)
+            # Sete t hat location to zero
+            grid[row][column]=1
+            print("Click ",pos,"Grid coordinates: ",row,column)
+
+    # Set the screen background
+    screen.fill(black)
+
+    # Draw the grid
+    for row in range(10):
+        for column in range(10):
+            color = white
+            if grid[row][column] == 1:
+                color = green
+            pygame.draw.rect(screen,color,[(margin+width)*column+margin,(margin+height)*row+margin,width,height])
+    
+    # Limit to 20 frames per second
+    clock.tick(20)
+
+    # Go ahead and update the screen with what we've drawn.
+    pygame.display.flip()
+    
+# Be IDLE friendly. If you forget this line, the program will 'hang'
+# on exit.
+pygame.quit ()
+

File examples/pygamewrapper/bounce_ball_with_paddle.py

+# Sample Python/Pygame Programs
+# Simpson College Computer Science
+# http://programarcadegames.com/
+# http://simpson.edu/computer-science/
+
+import pygamewrapper as pygame
+import random
+
+black = (0,0,0)
+white = (255,255,255)
+blue = (0,0,255)
+
+# This class represents the paddles on either side of the screen        
+# It derives from the "Sprite" class in Pygame
+class Player(pygame.sprite.Sprite):
+
+    # Class Attributes
+    width=10
+    height=75
+    my_joystick=None
+    
+    # Constructor. Pass in the color of the block, and its x and y position
+    def __init__(self, x, y, joystick_no):
+        # Call the parent class (Sprite) constructor
+        pygame.sprite.Sprite.__init__(self) 
+
+        # Variables to hold the height and width of the block
+
+        # Create an image of the ball, and fill it with a color.
+        # This could also be an image loaded from the disk.
+        self.image = pygame.Surface([self.width, self.height])
+        self.image.fill(white)
+
+        # Fetch the rectangle object that has the dimensions of the image
+        self.rect = self.image.get_rect()
+        
+        # Set initial position of sprite to 100,100
+        self.rect.x=x
+        self.rect.y=y
+        
+        # Count the joysticks the computer has
+        joystick_count=pygame.joystick.get_count()
+        if joystick_count < joystick_no+1:
+            # No joysticks!
+            print ("Error, I didn't find enough joysticks. Found ",joystick_count)
+        else:
+            # Use joystick #0 and initialize it
+            self.my_joystick = pygame.joystick.Joystick(joystick_no)
+            self.my_joystick.init()
+        
+
+    # Update the position of the ball
+    def update(self):
+        # As long as there is a joystick
+        if self.my_joystick != None:
+        
+            # This gets the position of the axis on the game controller
+            # It returns a number between -1.0 and +1.0
+            vert_axis_pos= self.my_joystick.get_axis(1)   
+            
+            # Move x according to the axis. We multiply by 10 to speed up the movement.
+            self.rect.y=self.rect.y+vert_axis_pos*10
+            
+            # If the user moves past the top/bottom of the screen, set the position
+            # to the edge.
+            if self.rect.y < 0:
+                self.rect.y = 0
+            if self.rect.y > screen_height - self.height:
+                self.rect.y = screen_height - self.height
+
+# This class represents the bar at the bottom that the player controls
+class Wall(pygame.sprite.Sprite):
+    # Constructor function
+    def __init__(self,x,y,width,height):
+        # Call the parent's constructor
+        pygame.sprite.Sprite.__init__(self)
+
+        # Make a blue wall, of the size specified in the parameters
+        self.image = pygame.Surface([width, height])
+        self.image.fill((blue))
+
+        # Make our top-left corner the passed-in location.
+        self.rect = self.image.get_rect()
+        self.rect.y = y
+        self.rect.x = x
+        
+        
+# This class represents the bar at the bottom that the player controls
+class Ball(pygame.sprite.Sprite):
+
+    # Set speed vector
+    change_x=0
+    change_y=0
+    walls=None
+    
+    # Constructor function
+    def __init__(self,x,y,walls):
+        # Call the parent's constructor
+        pygame.sprite.Sprite.__init__(self)
+ 
+        # Set height, width
+        self.image = pygame.Surface([15, 15])
+        self.image.fill(white)
+
+        # Make our top-left corner the passed-in location.
+        self.rect = self.image.get_rect()
+        self.rect.y = y
+        self.rect.x = x
+        
+        self.walls=walls
+        
+    # Find a new position for the player
+    def update(self):
+        # Get the old position, in case we need to go back to it
+        old_x=self.rect.x
+        new_x=old_x+self.change_x
+        self.rect.x = new_x
+        
+        # Did this update cause us to hit a wall?
+        collide = pygame.sprite.spritecollide(self, self.walls, False)
+        if collide:
+            # Whoops, hit a wall. Go back to the old position
+            self.rect.x=old_x
+            self.change_x *= -1
+
+        old_y=self.rect.y
+        new_y=old_y+self.change_y
+        self.rect.y = new_y
+        
+        # Did this update cause us to hit a wall?
+        collide = pygame.sprite.spritecollide(self, self.walls, False)
+        if collide:
+            # Whoops, hit a wall. Go back to the old position
+            self.rect.y=old_y
+            self.change_y *= -1
+            
+        if self.rect.x < -20 or self.rect.x > screen_width + 20:
+            self.change_x = 0
+            self.change_y = 0
+
+            
+# Call this function so the Pygame library can initialize itself
+pygame.init()
+
+# Create an 800x600 sized screen
+screen_width = 800
+screen_height = 600
+
+screen = pygame.display.set_mode([screen_width, screen_height])
+
+# Set the title of the window
+pygame.display.set_caption('Test')
+
+# All sprite lists
+wall_list=pygame.sprite.Group()
+all_sprites=pygame.sprite.Group()
+movingsprites = pygame.sprite.Group()
+
+# Create the players
+player1 = Player(10,screen_height/2,0)
+all_sprites.add(player1)
+wall_list.add(player1)
+movingsprites.add(player1)
+
+player2 = Player(screen_width-20,screen_height/2,1)
+all_sprites.add(player2)
+wall_list.add(player2)
+movingsprites.add(player2)
+
+# Make the walls. (x_pos, y_pos, width, height)
+# Top wall
+wall=Wall(0,0,screen_width,10) 
+wall_list.add(wall)
+all_sprites.add(wall)
+
+# Bottom wall
+wall=Wall(0,screen_height-10,screen_width,screen_height) 
+wall_list.add(wall)
+all_sprites.add(wall)
+
+# Create the ball
+ball = Ball( -50,-50, wall_list )
+movingsprites.add(ball)
+all_sprites.add(ball)
+
+clock = pygame.time.Clock()
+
+done = False
+
+# Main program loop
+while done == False:
+    
+    # Loop through any window events
+    for event in pygame.event.get():
+        # The user clicked 'close' or hit Alt-F4
+        if event.type == pygame.QUIT:
+            done=True
+            
+        # The user clicked the mouse button
+        # or pressed a key
+        if event.type == pygame.MOUSEBUTTONDOWN or event.type == pygame.KEYDOWN:
+            
+            # Is the ball not moving?
+            if ball.change_y == 0:
+                
+                # Start in the middle of the screen at a random y location
+                ball.rect.x = screen_width/2
+                ball.rect.y = random.randrange(10,screen_height-20)
+                
+                # Set a random vector
+                ball.change_y = random.randrange(-5,6)
+                ball.change_x =  random.randrange(5,10)
+                
+                # Is the ball headed left or right? Select randomly
+                if( random.randrange(2) == 0 ):
+                    ball.change_x *= -1
+
+                
+    # Update the ball position. Pass it the list of stuff it can bounce off of
+    movingsprites.update()
+    
+    # Clear the screen
+    screen.fill(black)
+    
+    # Draw the sprites
+    all_sprites.draw(screen)
+
+    # Display the screen
+    pygame.display.flip()
+
+    clock.tick(60)
+
+# All done, shut down Pygame            
+pygame.quit()
+

File examples/pygamewrapper/bullets.py

+# Sample Python/Pygame Programs
+# Simpson College Computer Science
+# http://programarcadegames.com/
+# http://simpson.edu/computer-science/
+
+import pygame
+import random
+
+# Define some colors
+black    = (   0,   0,   0)
+white    = ( 255, 255, 255)
+red      = ( 255,   0,   0)
+blue     = (   0,   0, 255)
+
+# This class represents the block        
+class Block(pygame.sprite.Sprite):
+    
+    def __init__(self, color):
+        # Call the parent class (Sprite) constructor
+        pygame.sprite.Sprite.__init__(self) 
+
+        self.image = pygame.Surface([20, 15])
+        self.image.fill(color)
+
+        self.rect = self.image.get_rect()
+
+# This class represents the Player        
+class Player(pygame.sprite.Sprite):
+    
+    def __init__(self):
+        # Call the parent class (Sprite) constructor
+        pygame.sprite.Sprite.__init__(self) 
+
+        self.image = pygame.Surface([20,20])
+        self.image.fill(red)
+
+        self.rect = self.image.get_rect()
+        
+# This class represents the bullet        
+class Bullet(pygame.sprite.Sprite):
+    
+    def __init__(self):
+        # Call the parent class (Sprite) constructor
+        pygame.sprite.Sprite.__init__(self) 
+
+        self.image = pygame.Surface([4, 10])
+        self.image.fill(black)
+
+        self.rect = self.image.get_rect()
+
+# Initialize Pygame
+pygame.init()
+
+# Set the height and width of the screen
+screen_width=700
+screen_height=400
+screen=pygame.display.set_mode([screen_width,screen_height])
+
+# This is a list of every sprite. All blocks and the player block as well.
+all_sprites_list = pygame.sprite.Group()
+
+# List of each block in the game
+block_list = pygame.sprite.Group()
+
+# List of each bullet
+bullet_list = pygame.sprite.Group()
+
+for i in range(50):
+    # This represents a block
+    block = Block(blue)
+
+    # Set a random location for the block
+    block.rect.x = random.randrange(screen_width)
+    block.rect.y = random.randrange(350)
+    
+    # Add the block to the list of objects
+    block_list.add(block)
+    all_sprites_list.add(block)
+
+# Create a red player block
+player = Player()
+all_sprites_list.add(player)
+
+#Loop until the user clicks the close button.
+done=False
+
+# Used to manage how fast the screen updates
+clock=pygame.time.Clock()
+
+score = 0
+player.rect.y=370
+
+# -------- Main Program Loop -----------
+while done==False:
+    # ALL EVENT PROCESSING SHOULD GO BELOW THIS COMMENT
+    for event in pygame.event.get(): # User did something
+        if event.type == pygame.QUIT: # If user clicked close
+            done=True # Flag that we are done so we exit this loop
+        if event.type == pygame.MOUSEBUTTONDOWN:
+            bullet = Bullet()
+            bullet.rect.x = player.rect.x
+            bullet.rect.y = player.rect.y
+            all_sprites_list.add(bullet)
+            bullet_list.add(bullet)
+
+    # ALL EVENT PROCESSING SHOULD GO ABOVE THIS COMMENT
+
+    # ALL GAME LOGIC SHOULD GO BELOW THIS COMMENT
+
+    # Calculate mechanics for each bullet
+    for bullet in bullet_list:
+        
+        # Move the bullet up 5 pixels
+        bullet.rect.y -= 5
+        
+        # See if it hit a block
+        block_hit_list = pygame.sprite.spritecollide(bullet, block_list, True)
+        
+        # For each block hit, remove the bollet and add to the score
+        for block in block_hit_list:
+            bullet_list.remove(bullet)
+            all_sprites_list.remove(bullet)
+            score += 1
+            print( score )
+            
+        # Remove the bullet if it flies up off the screen
+        if bullet.rect.y < -10:
+            bullet_list.remove(bullet)
+            all_sprites_list.remove(bullet)
+        
+    # Get the current mouse position. This returns the position
+    # as a list of two numbers.
+    pos = pygame.mouse.get_pos()
+
+    # Set the player x position to the mouse x position
+    player.rect.x=pos[0]
+    
+    # ALL GAME LOGIC SHOULD GO ABOVE THIS COMMENT
+
+    # ALL CODE TO DRAW SHOULD GO BELOW THIS COMMENT
+
+    # Clear the screen
+    screen.fill(white)
+        
+    # Draw all the spites
+    all_sprites_list.draw(screen)
+
+    # ALL CODE TO DRAW SHOULD GO ABOVE THIS COMMENT
+    
+    # Limit to 20 frames per second
+    clock.tick(20)
+
+    # Go ahead and update the screen with what we've drawn.
+    pygame.display.flip()
+
+pygame.quit()

File pgreloaded.wpu

 debug.run-args = {loc('setup.py'): 'install'}
 debug.show-args-dialog = {loc('../WebServer/CMSC150BookHTML/python_examples/bitmapped_graphics.py'): False,
                           loc('examples/pygamewrapper/bitmapped_graphics.py'): False,
+                          loc('examples/pygamewrapper/bounce_ball_with_paddle.py'): False,
                           loc('examples/pygamewrapper/draw_module_example.py'): False,
+                          loc('pygamewrapper/__init__.py'): False,
+                          loc('pygamewrapper/sprite/__init__.py'): False,
                           loc('setup.py'): False}
 guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                             'windows': [{'name': 'rSxuJnppc5C96BGvWCcyQQ3CaE'\
         (5,
          3),
         (5,
-         4),
+         5),
+        (5,
+         7),
+        (5,
+         8),
+        (5,
+         9),
         (6,)],
                                  'selected-nodes': [(5,
-        4,
+        3,
         0)],
                                  'top-node': (4,
         15)}},
                               ('browser',
                                'tall',
                                0,
-                               {'all_tree_states': {loc('../WebServer/CMSC150BookHTML/python_examples/sprite_collect_blocks.py'): {''\
+                               {'all_tree_states': {loc('../pygame_dev/professor-cravens-pygame-branch/config.py'): {''\
+        'column-widths': [1.0],
+        'expanded-nodes': [],
+        'selected-nodes': [],
+        'top-node': [('function def',
+                      loc('../pygame_dev/professor-cravens-pygame-branch/config.py'),
+                      'confirm')]},
+        u'By Module': {'column-widths': [1.0],
+                       'expanded-nodes': [],
+                       'selected-nodes': [None],
+                       'top-node': None},
+        loc('../WebServer/CMSC150BookHTML/python_examples/sprite_collect_blocks.py'): {''\
         'column-widths': [1.0],
         'expanded-nodes': [],
         'selected-nodes': [],
                              'expanded-nodes': [],
                              'selected-nodes': [],
                              'top-node': None},
-        loc('../pygame_dev/professor-cravens-pygame-branch/config.py'): {'co'\
-        'lumn-widths': [1.0],
-        'expanded-nodes': [],
-        'selected-nodes': [],
-        'top-node': [('function def',
-                      loc('../pygame_dev/professor-cravens-pygame-branch/config.py'),
-                      'confirm')]},
         loc('../pygame_dev/professor-cravens-pygame-branch/config_win.py'): {''\
         'column-widths': [1.0],
         'expanded-nodes': [[('class def',
         'top-node': [('generic attribute',
                       loc('../pygame_dev/professor-cravens-pygame-branch/config_win.py'),
                       'd')]},
-        loc('../pygame_dev/professor-cravens-pygame-branch/docs/reST/ref/code_examples/draw_module_example.py'): {''\
-        'column-widths': [1.0],
-        'expanded-nodes': [],
-        'selected-nodes': [],
-        'top-node': [('generic attribute',
-                      loc('../pygame_dev/professor-cravens-pygame-branch/docs/reST/ref/code_examples/draw_module_example.py'),
-                      'black')]},
         loc('../pygame_dev/professor-cravens-pygame-branch/lib/sprite.py'): {''\
         'column-widths': [1.0],
         'expanded-nodes': [],
         'top-node': [('class def',
                       loc('../pygame_dev/professor-cravens-pygame-branch/lib/sprite.py'),
                       'AbstractGroup')]},
+        loc('../test.py'): {'column-widths': [1.0],
+                            'expanded-nodes': [],
+                            'selected-nodes': [],
+                            'top-node': None},
+        loc('../../../Simpson/2013 Spring/student_hg/colegi2000@gmail.com/CMSC_150/Lab 07 - Bitmapped Graphics and User Control/Gipson_Corey_Lab_07/Gipson_Corey_Lab_07_Template.py'): {''\
+        'column-widths': [1.0],
+        'expanded-nodes': [],
+        'selected-nodes': [],
+        'top-node': [('generic attribute',
+                      loc('../../../Simpson/2013 Spring/student_hg/colegi2000@gmail.com/CMSC_150/Lab 07 - Bitmapped Graphics and User Control/Gipson_Corey_Lab_07/Gipson_Corey_Lab_07_Template.py'),
+                      'background')]},
+        loc('../../../../Python32/Lib/site-packages/pygame/sprite.py'): {'co'\
+        'lumn-widths': [1.0],
+        'expanded-nodes': [],
+        'selected-nodes': [],
+        'top-node': [('class def',
+                      loc('../../../../Python32/Lib/site-packages/pygame/sprite.py'),
+                      'AbstractGroup')]},
+        loc('../../../../Python33/Lib/site-packages/pygame2/sdl/render.py'): {''\
+        'column-widths': [1.0],
+        'expanded-nodes': [],
+        'selected-nodes': [],
+        'top-node': [('function def',
+                      loc('../../../../Python33/Lib/site-packages/pygame2/sdl/render.py'),
+                      'create_renderer')]},
+        u'All Classes': {'column-widths': [1.0],
+                         'expanded-nodes': [],
+                         'selected-nodes': [None],
+                         'top-node': None},
+        loc('../pygame_dev/professor-cravens-pygame-branch/docs/reST/ref/code_examples/draw_module_example.py'): {''\
+        'column-widths': [1.0],
+        'expanded-nodes': [],
+        'selected-nodes': [],
+        'top-node': [('generic attribute',
+                      loc('../pygame_dev/professor-cravens-pygame-branch/docs/reST/ref/code_examples/draw_module_example.py'),
+                      'black')]},
         loc('../pysdl/examples/draw_module_example.py'): {'column-widths': [1.0],
         'expanded-nodes': [],
         'selected-nodes': [[('generic attribute',
         'top-node': [('generic attribute',
                       loc('../pysdl/examples/draw_module_example.py'),
                       'black')]},
-        loc('../test.py'): {'column-widths': [1.0],
-                            'expanded-nodes': [],
-                            'selected-nodes': [],
-                            'top-node': None},
         loc('../../pygame_dev/professor-cravens-pygame-branch/docs/reST/ref/code_examples/joystick_calls.py'): {''\
         'column-widths': [1.0],
         'expanded-nodes': [],
         'top-node': [('generic attribute',
                       loc('../../pygame_dev/professor-cravens-pygame-branch/docs/reST/ref/code_examples/joystick_calls.py'),
                       'axes')]},
-        loc('../../../Simpson/2013 Spring/student_hg/colegi2000@gmail.com/CMSC_150/Lab 07 - Bitmapped Graphics and User Control/Gipson_Corey_Lab_07/Gipson_Corey_Lab_07_Template.py'): {''\
-        'column-widths': [1.0],
-        'expanded-nodes': [],
-        'selected-nodes': [],
-        'top-node': [('generic attribute',
-                      loc('../../../Simpson/2013 Spring/student_hg/colegi2000@gmail.com/CMSC_150/Lab 07 - Bitmapped Graphics and User Control/Gipson_Corey_Lab_07/Gipson_Corey_Lab_07_Template.py'),
-                      'background')]},
         loc('../../../Simpson/2013 Spring/student_hg/mike.henry@my.simpson.edu/CMSC_150/Lab 07 - Bitmapped Graphics and User Control/ALL THE THINGS/main_program.py'): {''\
         'column-widths': [1.0],
         'expanded-nodes': [],
         'top-node': [('generic attribute',
                       loc('../../AppData/Local/Wing IDE 4/pi-cache/3.2/C/Python32/Lib/site-packages/pygame/base.pi'),
                       '')]},
-        loc('../../../../Python32/Lib/site-packages/pygame/sprite.py'): {'co'\
-        'lumn-widths': [1.0],
-        'expanded-nodes': [],
-        'selected-nodes': [],
-        'top-node': [('class def',
-                      loc('../../../../Python32/Lib/site-packages/pygame/sprite.py'),
-                      'AbstractGroup')]},
         loc('../../../../Python33/Lib/ctypes/__init__.py'): {'column-widths': [1.0],
         'expanded-nodes': [],
         'selected-nodes': [],
         'top-node': [('generic attribute',
                       loc('../../../../Python33/Lib/site-packages/pygame2/dll/32bit/__init__.py'),
                       '')]},
-        loc('../../../../Python33/Lib/site-packages/pygame2/sdl/render.py'): {''\
-        'column-widths': [1.0],
-        'expanded-nodes': [],
-        'selected-nodes': [],
-        'top-node': [('function def',
-                      loc('../../../../Python33/Lib/site-packages/pygame2/sdl/render.py'),
-                      'create_renderer')]},
         loc('../../../../Python33/Lib/site-packages/pygame2/time/__init__.py'): {''\
         'column-widths': [1.0],
         'expanded-nodes': [],
         loc('unknown:<untitled> #5'): {'column-widths': [1.0],
                                        'expanded-nodes': [],
                                        'selected-nodes': [],
-                                       'top-node': None},
-        u'All Classes': {'column-widths': [1.0],
-                         'expanded-nodes': [],
-                         'selected-nodes': [None],
-                         'top-node': None},
-        u'By Module': {'column-widths': [1.0],
-                       'expanded-nodes': [],
-                       'selected-nodes': [None],
-                       'top-node': None}},
+                                       'top-node': None}},
                                 'browse_mode': u'Current Module',
                                 'follow-selection': False,
                                 'sort_mode': 'Alphabetically',
                       'wide',
                       1,
                       {'attrib-starts': [],
-                       'first-line': 0,
+                       'first-line': 2,
                        'folded-linenos': [],
-                       'sel-line': 4,
-                       'sel-line-start': 53,
-                       'selection_end': 53,
-                       'selection_start': 53}),
+                       'sel-line': 11,
+                       'sel-line-start': 568,
+                       'selection_end': 568,
+                       'selection_start': 568}),
                      ('debug-probe',
                       'wide',
                       2,
                                       'expanded-nodes': [],
                                       'selected-nodes': [],
                                       'top-node': (0,)}})],
-        'primary_view_state': {'editor_states': {'bookmarks': ([[loc('file:C:/Python33/Lib/site-packages/pygamewrapper/mixer/__init__.py'),
-        {'attrib-starts': [('Sound',
-                            5),
-                           ('Sound.__init__',
-                            8)],
-         'first-line': 3,
+        'primary_view_state': {'editor_states': {'bookmarks': ([(loc('pygamewrapper/__init__.py'),
+        {'attrib-starts': [('Rect',
+                            33),
+                           ('Rect.colliderect',
+                            45)],
+         'first-line': 31,
          'folded-linenos': [],
-         'sel-line': 8,
-         'sel-line-start': 130,
-         'selection_end': 134,
-         'selection_start': 134},
-        1364005303.0480001],
-        (loc('examples/pygamewrapper/draw_module_example.py'),
+         'sel-line': 46,
+         'sel-line-start': 1032,
+         'selection_end': 1119,
+         'selection_start': 1119},
+        1364067930.224),
+        (loc('setup.py'),
          {'attrib-starts': [],
-          'first-line': 12,
+          'first-line': 30,
           'folded-linenos': [],
-          'sel-line': 26,
-          'sel-line-start': 589,
-          'selection_end': 594,
-          'selection_start': 594},
-         1364005309.2349999),
-        (loc('pygamewrapper/mixer/__init__.py'),
+          'sel-line': 47,
+          'sel-line-start': 1519,
+          'selection_end': 1554,
+          'selection_start': 1554},
+         1364067932.395),
+        (loc('pygamewrapper/sprite/__init__.py'),
          {'attrib-starts': [],
-          'first-line': 0,
+          'first-line': 90,
           'folded-linenos': [],
-          'sel-line': 2,
-          'sel-line-start': 24,
-          'selection_end': 39,
-          'selection_start': 39},
-         1364005310.0869999),
+          'sel-line': 90,
+          'sel-line-start': 4305,
+          'selection_end': 4305,
+          'selection_start': 4305},
+         1364067934.2190001),
         (loc('setup.py'),
          {'attrib-starts': [],
-          'first-line': 67,
+          'first-line': 30,
           'folded-linenos': [],
-          'sel-line': 86,
-          'sel-line-start': 3278,
-          'selection_end': 3292,
-          'selection_start': 3292},
-         1364005315.609),
-        (loc('examples/pygamewrapper/bitmapped_graphics.py'),
+          'sel-line': 47,
+          'sel-line-start': 1519,
+          'selection_end': 1554,
+          'selection_start': 1554},
+         1364067937.473),
+        (loc('pygamewrapper/__init__.py'),
+         {'attrib-starts': [('Surface',
+                             49),
+                            ('Surface.__init__',
+                             56)],
+          'first-line': 38,
+          'folded-linenos': [],
+          'sel-line': 60,
+          'sel-line-start': 1420,
+          'selection_end': 1465,
+          'selection_start': 1465},
+         1364067938.096),
+        (loc('setup.py'),
          {'attrib-starts': [],
-          'first-line': 15,
+          'first-line': 30,
           'folded-linenos': [],
-          'sel-line': 31,
-          'sel-line-start': 815,
-          'selection_end': 815,
-          'selection_start': 815},
-         1364005318.6949999),
-        (loc('pygamewrapper/mixer/__init__.py'),
-         {'attrib-starts': [('Sound',
-                             5),
-                            ('Sound.play',
-                             11)],
+          'sel-line': 47,
+          'sel-line-start': 1519,
+          'selection_end': 1554,
+          'selection_start': 1554},
+         1364067988.944),
+        (loc('examples/pygamewrapper/bounce_ball_with_paddle.py'),
+         {'attrib-starts': [],
+          'first-line': 135,
+          'folded-linenos': [],
+          'sel-line': 143,
+          'sel-line-start': 4858,
+          'selection_end': 4858,
+          'selection_start': 4858},
+         1364067993.03),
+        (loc('file:C:/Python33/Lib/site-packages/pygamewrapper/display/__init__.py'),
+         {'attrib-starts': [('Window',
+                             13),
+                            ('Window.blit',
+                             27)],
+          'first-line': 21,
+          'folded-linenos': [],
+          'sel-line': 35,
+          'sel-line-start': 953,
+          'selection_end': 953,
+          'selection_start': 953},
+         1364067995.4590001),
+        (loc('file:C:/Python33/Lib/site-packages/pygamewrapper/sprite/__init__.py'),
+         {'attrib-starts': [('AbstractGroup',
+                             283),
+                            ('AbstractGroup.draw',
+                             463)],
+          'first-line': 469,
+          'folded-linenos': [],
+          'sel-line': 474,
+          'sel-line-start': 17111,
+          'selection_end': 17111,
+          'selection_start': 17111},
+         1364068042.9419999),
+        (loc('file:C:/Python33/Lib/site-packages/pygamewrapper/display/__init__.py'),
+         {'attrib-starts': [('Window',
+                             13),
+                            ('Window.blit',
+                             27)],
+          'first-line': 21,
+          'folded-linenos': [],
+          'sel-line': 35,
+          'sel-line-start': 953,
+          'selection_end': 953,
+          'selection_start': 953},
+         1364068052.7360001),
+        [loc('pygamewrapper/joystick/__init__.py'),
+         {'attrib-starts': [('get_count',
+                             2)],
           'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 14,
-          'sel-line-start': 346,
-          'selection_end': 381,
-          'selection_start': 381},
-         1364005336.1429999),
-        (loc('setup.py'),
-         {'attrib-starts': [],
-          'first-line': 67,
+          'sel-line': 3,
+          'sel-line-start': 49,
+          'selection_end': 105,
+          'selection_start': 105},
+         1364068064.069],
+        (loc('file:C:/Python33/Lib/site-packages/pygamewrapper/display/__init__.py'),
+         {'attrib-starts': [('Window',
+                             13),
+                            ('Window.blit',
+                             27)],
+          'first-line': 21,
           'folded-linenos': [],
-          'sel-line': 86,
-          'sel-line-start': 3278,
-          'selection_end': 3292,
-          'selection_start': 3292},
-         1364005385.5699999),
-        (loc('examples/pygamewrapper/draw_module_example.py'),
+          'sel-line': 35,
+          'sel-line-start': 953,
+          'selection_end': 953,
+          'selection_start': 953},
+         1364068065.448),
+        [loc('pygamewrapper/image/__init__.py'),
          {'attrib-starts': [],
-          'first-line': 12,
+          'first-line': 0,
+          'folded-linenos': [],
+          'sel-line': 4,
+          'sel-line-start': 91,
+          'selection_end': 91,
+          'selection_start': 91},
+         1364068065.974],
+        (loc('file:C:/Python33/Lib/site-packages/pygamewrapper/display/__init__.py'),
+         {'attrib-starts': [('Window',
+                             13),
+                            ('Window.blit',
+                             27)],
+          'first-line': 21,
           'folded-linenos': [],
-          'sel-line': 26,
-          'sel-line-start': 589,
-          'selection_end': 594,
-          'selection_start': 594},
-         1364005389.796),
+          'sel-line': 35,
+          'sel-line-start': 953,
+          'selection_end': 953,
+          'selection_start': 953},
+         1364068066.4719999),
         (loc('examples/pygamewrapper/bitmapped_graphics.py'),
          {'attrib-starts': [],
           'first-line': 15,
           'sel-line-start': 815,
           'selection_end': 815,
           'selection_start': 815},
-         1364005390.928),
-        (loc('file:C:/Python33/Lib/site-packages/pygame2/openal/al.py'),
-         {'attrib-starts': [('_raise_error_or_continue',
-                             130)],
-          'first-line': 115,
-          'folded-linenos': [],
-          'sel-line': 137,
-          'sel-line-start': 4188,
-          'selection_end': 4188,
-          'selection_start': 4188},
-         1364005395.993),
-        (loc('setup.py'),
+         1364068085.727),
+        [loc('file:C:/Python33/Lib/site-packages/pygamewrapper/image/__init__.py'),
          {'attrib-starts': [],
-          'first-line': 67,
-          'folded-linenos': [],
-          'sel-line': 86,
-          'sel-line-start': 3278,
-          'selection_end': 3292,
-          'selection_start': 3292},
-         1364005417.71),
-        (loc('pygamewrapper/mixer/__init__.py'),
-         {'attrib-starts': [('Sound',
-                             5),
-                            ('Sound.play',
-                             11)],
           'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 14,
-          'sel-line-start': 346,
-          'selection_end': 381,
-          'selection_start': 381},
-         1364005418.7190001),
+          'sel-line': 0,
+          'sel-line-start': 0,
+          'selection_end': 0,
+          'selection_start': 0},
+         1364068089.4619999],
         (loc('examples/pygamewrapper/bitmapped_graphics.py'),
          {'attrib-starts': [],
           'first-line': 15,
           'sel-line-start': 815,
           'selection_end': 815,
           'selection_start': 815},
-         1364005464.428),
-        (loc('file:C:/Python33/Lib/site-packages/pygame2/openal/al.py'),
-         {'attrib-starts': [('_raise_error_or_continue',
-                             130)],
-          'first-line': 115,
-          'folded-linenos': [],
-          'sel-line': 137,
-          'sel-line-start': 4188,
-          'selection_end': 4188,
-          'selection_start': 4188},
-         1364005471.733),
-        (loc('setup.py'),
-         {'attrib-starts': [],
-          'first-line': 67,
-          'folded-linenos': [],
-          'sel-line': 86,
-          'sel-line-start': 3278,
-          'selection_end': 3292,
-          'selection_start': 3292},
-         1364005476.8150001),
-        (loc('pygamewrapper/mixer/__init__.py'),
+         1364068112.585),
+        (loc('pygamewrapper/image/__init__.py'),
          {'attrib-starts': [],
           'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 2,
-          'sel-line-start': 24,
-          'selection_end': 51,
-          'selection_start': 51},
-         1364005477.8729999),
+          'sel-line': 5,
+          'sel-line-start': 113,
+          'selection_end': 113,
+          'selection_start': 113},
+         1364068117.256),
         (loc('setup.py'),
          {'attrib-starts': [],
-          'first-line': 67,
-          'folded-linenos': [],
-          'sel-line': 86,
-          'sel-line-start': 3278,
-          'selection_end': 3292,
-          'selection_start': 3292},
-         1364005505.8239999),
-        (loc('examples/pygamewrapper/bitmapped_graphics.py'),
-         {'attrib-starts': [],
-          'first-line': 15,
-          'folded-linenos': [],
-          'sel-line': 31,
-          'sel-line-start': 815,
-          'selection_end': 815,
-          'selection_start': 815},
-         1364005507.546),
-        [loc('file:C:/Python33/Lib/site-packages/pygame2/openal/al.py'),
-         {'attrib-starts': [('_raise_error_or_continue',
-                             130)],
-          'first-line': 115,
+          'first-line': 30,
           'folded-linenos': [],
-          'sel-line': 137,
-          'sel-line-start': 4188,
-          'selection_end': 4188,
-          'selection_start': 4188},
-         1364005508.0090001],
+          'sel-line': 47,
+          'sel-line-start': 1519,
+          'selection_end': 1554,
+          'selection_start': 1554},
+         1364068130.812),
         [loc('examples/pygamewrapper/bitmapped_graphics.py'),
          {'attrib-starts': [],
           'first-line': 15,
           'sel-line-start': 815,
           'selection_end': 815,
           'selection_start': 815},
-         1364005524.6930001]],
+         1364068134.987]],
         19),
         'current-loc': loc('examples/pygamewrapper/bitmapped_graphics.py'),
         'editor-states': {loc('examples/pygamewrapper/bitmapped_graphics.py'): {''\
         'sel-line-start': 815,
         'selection_end': 815,
         'selection_start': 815},
+                          loc('examples/pygamewrapper/bounce_ball_with_paddle.py'): {''\
+        'attrib-starts': [],
+        'first-line': 135,
+        'folded-linenos': [],
+        'sel-line': 143,
+        'sel-line-start': 4858,
+        'selection_end': 4858,
+        'selection_start': 4858},
                           loc('examples/pygamewrapper/draw_module_example.py'): {''\
         'attrib-starts': [],
-        'first-line': 12,
+        'first-line': 0,
         'folded-linenos': [],
         'sel-line': 26,
         'sel-line-start': 589,
         'selection_end': 594,
         'selection_start': 594},
-                          loc('pygamewrapper/mixer/__init__.py'): {'attrib-s'\
+                          loc('pygamewrapper/__init__.py'): {'attrib-starts': [(''\
+        'Surface',
+        49),
+        ('Surface.__init__',
+         56)],
+        'first-line': 38,
+        'folded-linenos': [],
+        'sel-line': 60,
+        'sel-line-start': 1420,
+        'selection_end': 1465,
+        'selection_start': 1465},
+                          loc('pygamewrapper/image/__init__.py'): {'attrib-s'\
         'tarts': [],
         'first-line': 0,
         'folded-linenos': [],
-        'sel-line': 2,
-        'sel-line-start': 24,
-        'selection_end': 51,
-        'selection_start': 51},
+        'sel-line': 5,
+        'sel-line-start': 113,
+        'selection_end': 113,
+        'selection_start': 113},
+                          loc('pygamewrapper/sprite/__init__.py'): {'attrib-'\
+        'starts': [],
+        'first-line': 90,
+        'folded-linenos': [],
+        'sel-line': 90,
+        'sel-line-start': 4305,
+        'selection_end': 4305,
+        'selection_start': 4305},
                           loc('setup.py'): {'attrib-starts': [],
-        'first-line': 67,
+        'first-line': 30,
         'folded-linenos': [],
-        'sel-line': 86,
-        'sel-line-start': 3278,
-        'selection_end': 3292,
-        'selection_start': 3292}},
+        'sel-line': 47,
+        'sel-line-start': 1519,
+        'selection_end': 1554,
+        'selection_start': 1554}},
         'has-focus': True,
         'locked': False},
                                'open_files': [u'examples/pygamewrapper/draw_module_example.py',
-        u'pygamewrapper/mixer/__init__.py',
+        u'pygamewrapper/sprite/__init__.py',
+        u'pygamewrapper/__init__.py',
+        u'examples/pygamewrapper/bounce_ball_with_paddle.py',
+        u'pygamewrapper/image/__init__.py',
         u'setup.py',
         u'examples/pygamewrapper/bitmapped_graphics.py']},
         'saved_notebook_display': None,
                  'user_data': {}},
         'window-alloc': (1679,
                          31,
-                         1062,
+                         1618,
                          870)}]}
 guimgr.recent-documents = [loc('examples/pygamewrapper/bitmapped_graphics.py'),
                            loc('setup.py'),
-                           loc('pygamewrapper/mixer/__init__.py'),
+                           loc('pygamewrapper/image/__init__.py'),
+                           loc('examples/pygamewrapper/bounce_ball_with_paddle.py'),
+                           loc('pygamewrapper/__init__.py'),
+                           loc('pygamewrapper/sprite/__init__.py'),
                            loc('examples/pygamewrapper/draw_module_example.py')]
 guimgr.visual-state = {loc('file:C:/Python33/Lib/site-packages/pygame2/openal/al.py'): {''\
         'attrib-starts': [('_raise_error_or_continue',
         'sel-line-start': 4188,
         'selection_end': 4188,
         'selection_start': 4188},
+                       loc('file:C:/Python33/Lib/site-packages/pygame2/sdl/surface.py'): {''\
+        'attrib-starts': [('fill_rect',
+                           200)],
+        'first-line': 186,
+        'folded-linenos': [],
+        'sel-line': 208,
+        'sel-line-start': 8143,
+        'selection_end': 8143,
+        'selection_start': 8143},
                        loc('file:C:/Python33/Lib/site-packages/pygame2/sdlimage.py'): {''\
         'attrib-starts': [],
         'first-line': 23,
         'sel-line-start': 1288,
         'selection_end': 1331,
         'selection_start': 1331},
+                       loc('file:C:/Python33/Lib/site-packages/pygamewrapper/__init__.py'): {''\
+        'attrib-starts': [('Surface',
+                           40),
+                          ('Surface.__init__',
+                           44)],
+        'first-line': 42,
+        'folded-linenos': [],
+        'sel-line': 48,
+        'sel-line-start': 1062,
+        'selection_end': 1091,
+        'selection_start': 1062},
+                       loc('file:C:/Python33/Lib/site-packages/pygamewrapper/display/__init__.py'): {''\
+        'attrib-starts': [('Window',
+                           13),
+                          ('Window.blit',
+                           27)],
+        'first-line': 21,
+        'folded-linenos': [],
+        'sel-line': 35,
+        'sel-line-start': 953,
+        'selection_end': 953,
+        'selection_start': 953},
+                       loc('file:C:/Python33/Lib/site-packages/pygamewrapper/image/__init__.py'): {''\
+        'attrib-starts': [],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 1,
+        'sel-line-start': 20,
+        'selection_end': 41,
+        'selection_start': 27},
+                       loc('file:C:/Python33/Lib/site-packages/pygamewrapper/joystick/__init__.py'): {''\
+        'attrib-starts': [('get_count',
+                           2)],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 3,
+        'sel-line-start': 49,
+        'selection_end': 105,
+        'selection_start': 53},
                        loc('file:C:/Python33/Lib/site-packages/pygamewrapper/mixer/__init__.py'): {''\
         'attrib-starts': [],
         'first-line': 0,
         'sel-line-start': 24,
         'selection_end': 31,
         'selection_start': 31},
-                       loc('file:C:/Python33/Lib/wave.py'): {'attrib-starts': [(''\
+                       loc('file:C:/Python33/Lib/site-packages/pygamewrapper/sprite/__init__.py'): {''\
+        'attrib-starts': [('AbstractGroup',
+                           283),
+                          ('AbstractGroup.draw',
+                           463)],
+        'first-line': 469,
+        'folded-linenos': [],
+        'sel-line': 474,
+        'sel-line-start': 17111,
+        'selection_end': 17111,
+        'selection_start': 17111},
+                       loc('file:C:/Python33/lib/wave.py'): {'attrib-starts': [(''\
         'Wave_read',
         93),
         ('Wave_read.initfp',
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
+                       loc('examples/pygamewrapper/animating_snow.py'): {'at'\
+        'trib-starts': [],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 8,
+        'sel-line-start': 246,
+        'selection_end': 276,
+        'selection_start': 276},
+                       loc('examples/pygamewrapper/array_backed_grid.py'): {''\
+        'attrib-starts': [],
+        'first-line': 42,
+        'folded-linenos': [],
+        'sel-line': 5,
+        'sel-line-start': 145,
+        'selection_end': 175,
+        'selection_start': 175},
                        loc('pygame2/sdl/render.py'): {'attrib-starts': [],
         'first-line': 459,
         'folded-linenos': [],
         'sel-line-start': 3493,
         'selection_end': 3515,
         'selection_start': 3515},
-                       loc('pygamewrapper/__init__.py'): {'attrib-starts': [],
+                       loc('pygamewrapper/__init__.py'): {'attrib-starts': [(''\
+        'Rect',
+        24),
+        ('Rect.__init__',
+         29)],
         'first-line': 0,
         'folded-linenos': [],
-        'sel-line': 13,
-        'sel-line-start': 309,
-        'selection_end': 365,
-        'selection_start': 365},
+        'sel-line': 33,
+        'sel-line-start': 705,
+        'selection_end': 717,
+        'selection_start': 717},
                        loc('pygamewrapper/display/__init__.py'): {'attrib-st'\
         'arts': [('fix_color',
                   7)],
         'selection_end': 221,
         'selection_start': 221},
                        loc('pygamewrapper/image/__init__.py'): {'attrib-star'\
-        'ts': [('Image',
-                5),
-               ('Image.set_colorkey',
-                14)],
-        'first-line': 3,
+        'ts': [],
+        'first-line': 0,
         'folded-linenos': [],
-        'sel-line': 15,
-        'sel-line-start': 244,
-        'selection_end': 258,
-        'selection_start': 258},
+        'sel-line': 4,
+        'sel-line-start': 91,
+        'selection_end': 91,
+        'selection_start': 91},
+                       loc('pygamewrapper/joystick/__init__.py'): {'attrib-s'\
+        'tarts': [('get_count',
+                   2)],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 3,
+        'sel-line-start': 49,
+        'selection_end': 105,
+        'selection_start': 105},
                        loc('pygamewrapper/mixer/__init__.py'): {'attrib-star'\
         'ts': [('Sound',
-                2),
+                5),
                ('Sound.__init__',
-                6)],
+                8)],
         'first-line': 0,
         'folded-linenos': [],
-        'sel-line': 8,
-        'sel-line-start': 174,
-        'selection_end': 210,
-        'selection_start': 210},
+        'sel-line': 9,
+        'sel-line-start': 173,
+        'selection_end': 227,
+        'selection_start': 227},
                        loc('pygamewrapper/mouse/__init__.py'): {'attrib-star'\
         'ts': [('get_pos',
                 2)],
         'sel-line-start': 93,
         'selection_end': 125,
         'selection_start': 125},
-                       loc('pygamewrapper/time/__init__.py'): {'attrib-start'\
+                       loc('pygamewrapper/rect/__init__.py'): {'attrib-start'\
         's': [],
         'first-line': 0,
         'folded-linenos': [],
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
+                       loc('pygamewrapper/sprite/__init__.py'): {'attrib-sta'\
+        'rts': [],
+        'first-line': 84,
+        'folded-linenos': [],
+        'sel-line': 90,
+        'sel-line-start': 4305,
+        'selection_end': 4305,
+        'selection_start': 4305},
+                       loc('pygamewrapper/time/__init__.py'): {'attrib-start'\
+        's': [],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 0,
+        'sel-line-start': 0,
+        'selection_end': 24,
+        'selection_start': 24},
                        loc('setup.py'): {'attrib-starts': [],
         'first-line': 76,
         'folded-linenos': [],
         None),
                   loc('examples/draw_module_example.py'): ('project',
         None),
+                  loc('examples/pygamewrapper/animating_snow.py'): ('project',
+        None),
+                  loc('examples/pygamewrapper/array_backed_grid.py'): ('proj'\
+        'ect',
+        None),
                   loc('examples/pygamewrapper/bitmapped_graphics.py'): ('pro'\
         'ject',
         None),
+                  loc('examples/pygamewrapper/bounce_ball_with_paddle.py'): (''\
+        'project',
+        None),
                   loc('examples/pygamewrapper/draw_module_example.py'): ('pr'\
         'oject',
         None),
                   loc('pygame2/sdl/surface.py'): ('project',
         None),
+                  loc('pygamewrapper/__init__.py'): ('project',
+        None),
                   loc('pygamewrapper/mixer/__init__.py'): ('project',
         None),
+                  loc('pygamewrapper/sprite/__init__.py'): ('project',
+        None),
                   loc('setup.py'): ('project',
                                     None),
                   loc('src/main.cpp'): ('project',
         ['']),
                  loc('examples/draw_module_example.py'): ('project',
         ['']),
+                 loc('examples/pygamewrapper/animating_snow.py'): ('project',
+        ['']),
+                 loc('examples/pygamewrapper/array_backed_grid.py'): ('proje'\
+        'ct',
+        ['']),
                  loc('examples/pygamewrapper/bitmapped_graphics.py'): ('proj'\
         'ect',
         ['']),
+                 loc('examples/pygamewrapper/bounce_ball_with_paddle.py'): (''\
+        'project',
+        ['']),
                  loc('examples/pygamewrapper/draw_module_example.py'): ('pro'\
         'ject',
         ['']),
                  loc('pygame2/sdl/surface.py'): ('project',
         ['']),
+                 loc('pygamewrapper/__init__.py'): ('project',
+        ['']),
                  loc('pygamewrapper/mixer/__init__.py'): ('project',
         ['']),
+                 loc('pygamewrapper/sprite/__init__.py'): ('project',
+        ['']),
                  loc('setup.py'): ('project',
                                    ['']),
                  loc('src/main.cpp'): ('project',

File pygamewrapper/__init__.py

 import pygamewrapper.image
 import pygamewrapper.mouse
 import pygamewrapper.mixer
+import pygamewrapper.sprite
+import pygamewrapper.joystick
+import pygamewrapper.rect
 
 import pygame2.sdl
 import pygame2.sdl.hints
 import pygame2.sdl.events
+import pygame2.sdl.rect
+import pygame2.sdl.surface
 
 QUIT = pygame2.sdl.events.SDL_QUIT
 MOUSEBUTTONDOWN = pygame2.sdl.events.SDL_MOUSEBUTTONDOWN
+KEYDOWN = pygame2.sdl.events.SDL_KEYDOWN
+KEYUP = pygame2.sdl.events.SDL_KEYUP
 
 def init():
 	pygame2.sdl.hints.set_hint(pygame2.sdl.hints.SDL_HINT_RENDER_DRIVER,"opengl");
 	print("pygame wrapper init")
 
 def quit():
-	pygame2.sdl.quit()
+	pygame2.sdl.quit()
+
+def get_int_color( color ):
+	return (color[0] << 16) + (color[1] << 8) + color[0]
+	
+class Rect():
+	x = 0
+	y = 0
+	w = 0
+	h = 0
+	
+	def __init__(self, x, y, w, h):
+		self.x = x
+		self.y = y
+		self.w = w
+		self.h = h
+	
+	def colliderect(self, r2):
+		if self.x < r2.x+r2.w and self.x+self.w > r2.x and self.y < r2.y+r2.h and self.y+self.h > r2.y:
+			return True
+						
+class Surface():
+	my_surface = None
+	my_texture = None
+	rect = None
+	width = 0
+	height = 0
+	
+	def __init__(self, size):
+		self.width = size[0]
+		self.height = size[1]
+		self.my_surface = pygame2.sdl.surface.create_rgb_surface(self.width, self.height, 8)
+		self.rect = Rect(0,0,self.width,self.height)
+
+		
+	def fill(self, color):
+		rect = pygame2.sdl.rect.SDL_Rect()
+		rect.x = 0
+		rect.y = 0
+		rect.h = self.rect.h
+		rect.w = self.rect.w
+		pygame2.sdl.surface.fill_rect(self.my_surface, rect, pygamewrapper.get_int_color(color) )
+	
+	def get_rect(self):
+		return self.rect

File pygamewrapper/image/__init__.py

 import pygamewrapper.display
 import pygame2
 import pygame2.sdlimage
+import pygamewrapper
 
 class Image():
 	surface = None
 		return self
 		
 	def set_colorkey(self, color):
-		int_color = (color[0] << 16) + (color[1] << 8) + color[0]
-		print( "{:x}".format(int_color) )
-		#int_color = 0xFFFFFFFF
+		int_color = pygamewrapper.get_int_color(color)
 		pygame2.sdl.surface.set_color_key(self.surface, pygame2.sdl.SDL_TRUE, int_color)
 		self.texture = pygame2.sdl.render.create_texture_from_surface(pygamewrapper.display.current_window.renderer,self.surface)
 

File pygamewrapper/joystick/__init__.py

+import pygame2.sdl.joystick
+
+def get_count():
+    return pygame2.sdl.joystick.joystick_num_joysticks()

File pygamewrapper/rect/__init__.py

Empty file added.

File pygamewrapper/sprite/__init__.py

+##    pygame - Python Game Library
+##    Copyright (C) 2000-2003, 2007  Pete Shinners
+##              (C) 2004 Joe Wreschnig
+##    This library is free software; you can redistribute it and/or
+##    modify it under the terms of the GNU Library General Public
+##    License as published by the Free Software Foundation; either
+##    version 2 of the License, or (at your option) any later version.
+##
+##    This library is distributed in the hope that it will be useful,
+##    but WITHOUT ANY WARRANTY; without even the implied warranty of
+##    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##    Library General Public License for more details.
+##
+##    You should have received a copy of the GNU Library General Public
+##    License along with this library; if not, write to the Free
+##    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+##    Pete Shinners
+##    pete@shinners.org
+
+"""pygame module with basic game object classes
+
+This module contains several simple classes to be used within games. There
+are the main Sprite class and several Group classes that contain Sprites.
+The use of these classes is entirely optional when using Pygame. The classes
+are fairly lightweight and only provide a starting place for the code
+that is common to most games.
+
+The Sprite class is intended to be used as a base class for the different
+types of objects in the game. There is also a base Group class that simply
+stores sprites. A game could create new types of Group classes that operate
+on specially customized Sprite instances they contain.
+
+The basic Sprite class can draw the Sprites it contains to a Surface. The
+Group.draw() method requires that each Sprite have a Surface.image attribute
+and a Surface.rect. The Group.clear() method requires these same attributes
+and can be used to erase all the Sprites with background. There are also
+more advanced Groups: pygame.sprite.RenderUpdates() and
+pygame.sprite.OrderedUpdates().
+
+Lastly, this module contains several collision functions. These help find
+sprites inside multiple groups that have intersecting bounding rectangles.
+To find the collisions, the Sprites are required to have a Surface.rect
+attribute assigned.
+
+The groups are designed for high efficiency in removing and adding Sprites
+to them. They also allow cheap testing to see if a Sprite already exists in
+a Group. A given Sprite can exist in any number of groups. A game could use
+some groups to control object rendering, and a completely separate set of
+groups to control interaction or player movement. Instead of adding type
+attributes or bools to a derived Sprite class, consider keeping the
+Sprites inside organized Groups. This will allow for easier lookup later
+in the game.
+
+Sprites and Groups manage their relationships with the add() and remove()
+methods. These methods can accept a single or multiple group arguments for
+membership.  The default initializers for these classes also take a
+single group or list of groups as argments for initial membership. It is safe
+to repeatedly add and remove the same Sprite from a Group.
+
+While it is possible to design sprite and group classes that don't derive
+from the Sprite and AbstractGroup classes below, it is strongly recommended
+that you extend those when you create a new Sprite or Group class.
+
+Sprites are not thread safe, so lock them yourself if using threads.
+
+"""
+
+##todo
+## a group that holds only the 'n' most recent elements.
+## sort of like the GroupSingle class, but holding more
+## than one sprite
+##
+## drawing groups that can 'automatically' store the area
+## underneath so they can "clear" without needing a background
+## function. obviously a little slower than normal, but nice
+## to use in many situations. (also remember it must "clear"
+## in the reverse order that it draws :])
+##
+## the drawing groups should also be able to take a background
+## function, instead of just a background surface. the function
+## would take a surface and a rectangle on that surface to erase.
+##
+## perhaps more types of collision functions? the current two
+## should handle just about every need, but perhaps more optimized
+## specific ones that aren't quite so general but fit into common
+## specialized cases.
+
+import pygamewrapper as pygame
+from pygamewrapper import Rect
+from pygamewrapper.time import get_ticks
+from operator import truth
+
+# Python 3 does not have the callable function, but an equivalent can be made
+# with the hasattr function.
+if 'callable' not in dir(__builtins__):
+    callable = lambda obj: hasattr(obj, '__call__')
+
+# Don't depend on pygame.mask if it's not there...
+try:
+    from pygame.mask import from_surface
+except:
+    pass
+
+
+class Sprite(object):
+    """simple base class for visible game objects
+
+    pygame.sprite.Sprite(*groups): return Sprite
+
+    The base class for visible game objects. Derived classes will want to
+    override the Sprite.update() method and assign Sprite.image and Sprite.rect
+    attributes.  The initializer can accept any number of Group instances that
+    the Sprite will become a member of.
+
+    When subclassing the Sprite class, be sure to call the base initializer
+    before adding the Sprite to Groups.
+
+    """
+
+    def __init__(self, *groups):
+        self.__g = {} # The groups the sprite is in
+        if groups:
+            self.add(*groups)
+
+    def add(self, *groups):
+        """add the sprite to groups
+
+        Sprite.add(*groups): return None
+
+        Any number of Group instances can be passed as arguments. The
+        Sprite will be added to the Groups it is not already a member of.
+
+        """
+        has = self.__g.__contains__
+        for group in groups:
+            if hasattr(group, '_spritegroup'):
+                if not has(group):
+                    group.add_internal(self)
+                    self.add_internal(group)
+            else:
+                self.add(*group)
+
+    def remove(self, *groups):
+        """remove the sprite from groups
+
+        Sprite.remove(*groups): return None
+
+        Any number of Group instances can be passed as arguments. The Sprite
+        will be removed from the Groups it is currently a member of.
+
+        """
+        has = self.__g.__contains__
+        for group in groups:
+            if hasattr(group, '_spritegroup'):
+                if has(group):
+                    group.remove_internal(self)
+                    self.remove_internal(group)
+            else:
+                self.remove(*group)
+
+    def add_internal(self, group):
+        self.__g[group] = 0
+
+    def remove_internal(self, group):
+        del self.__g[group]
+
+    def update(self, *args):
+        """method to control sprite behavior
+
+        Sprite.update(*args):
+
+        The default implementation of this method does nothing; it's just a
+        convenient "hook" that you can override. This method is called by
+        Group.update() with whatever arguments you give it.
+
+        There is no need to use this method if not using the convenience
+        method by the same name in the Group class.
+
+        """
+        pass
+
+    def kill(self):
+        """remove the Sprite from all Groups
+
+        Sprite.kill(): return None
+
+        The Sprite is removed from all the Groups that contain it. This won't
+        change anything about the state of the Sprite. It is possible to
+        continue to use the Sprite after this method has been called, including
+        adding it to Groups.
+
+        """
+        for c in self.__g:
+            c.remove_internal(self)
+        self.__g.clear()
+
+    def groups(self):
+        """list of Groups that contain this Sprite
+
+        Sprite.groups(): return group_list
+
+        Returns a list of all the Groups that contain this Sprite.
+
+        """
+        return list(self.__g)
+
+    def alive(self):
+        """does the sprite belong to any groups
+
+        Sprite.alive(): return bool
+
+        Returns True when the Sprite belongs to one or more Groups.
+        """
+        return truth(self.__g)
+
+    def __repr__(self):
+        return "<%s sprite(in %d groups)>" % (self.__class__.__name__, len(self.__g))
+
+
+class DirtySprite(Sprite):
+    """a more featureful subclass of Sprite with more attributes
+
+    pygame.sprite.DirtySprite(*groups): return DirtySprite
+
+    Extra DirtySprite attributes with their default values:
+
+    dirty = 1
+        If set to 1, it is repainted and then set to 0 again.
+        If set to 2, it is always dirty (repainted each frame;
+        flag is not reset).
+        If set to 0, it is not dirty and therefore not repainted again.
+
+    blendmode = 0
+        It's the special_flags argument of Surface.blit; see the blendmodes in
+        the Surface.blit documentation
+
+    source_rect = None
+        This is the source rect to use. Remember that it is relative to the top
+        left corner (0, 0) of self.image.
+
+    visible = 1
+        Normally this is 1. If set to 0, it will not be repainted. (If you
+        change visible to 1, you must set dirty to 1 for it to be erased from
+        the screen.)
+
+    _layer = 0
+        A READ ONLY value, it is read when adding it to the LayeredUpdates
+        group. For details see documentation of sprite.LayeredUpdates.
+
+    """
+
+    def __init__(self, *groups):
+
+        self.dirty = 1
+        self.blendmode = 0  # pygame 1.8, referred to as special_flags in
+                            # the documentation of Surface.blit
+        self._visible = 1
+        self._layer = 0     # READ ONLY by LayeredUpdates or LayeredDirty
+        self.source_rect = None
+        Sprite.__init__(self, *groups)
+
+    def _set_visible(self, val):
+        """set the visible value (0 or 1) and makes the sprite dirty"""
+        self._visible = val
+        if self.dirty < 2:
+            self.dirty = 1
+
+    def _get_visible(self):
+        """return the visible value of that sprite"""
+        return self._visible
+
+    visible = property(lambda self: self._get_visible(),
+                       lambda self, value: self._set_visible(value),
+                       doc="you can make this sprite disappear without "
+                           "removing it from the group,\n"
+                           "assign 0 for invisible and 1 for visible")
+
+    def __repr__(self):
+        return "<%s DirtySprite(in %d groups)>" % \
+            (self.__class__.__name__, len(self.groups()))
+
+
+class AbstractGroup(object):
+    """base class for containers of sprites
+
+    AbstractGroup does everything needed to behave as a normal group. You can
+    easily subclass a new group class from this or the other groups below if
+    you want to add more features.
+
+    Any AbstractGroup-derived sprite groups act like sequences and support
+    iteration, len, and so on.
+
+    """
+
+    # dummy val to identify sprite groups, and avoid infinite recursion
+    _spritegroup = True
+
+    def __init__(self):
+        self.spritedict = {}
+        self.lostsprites = []
+
+    def sprites(self):
+        """get a list of sprites in the group
+
+        Group.sprite(): return list
+
+        Returns an object that can be looped over with a 'for' loop. (For now,
+        it is always a list, but this could change in a future version of
+        pygame.) Alternatively, you can get the same information by iterating
+        directly over the sprite group, e.g. 'for sprite in group'.
+
+        """
+        return list(self.spritedict)
+
+    def add_internal(self, sprite):
+        self.spritedict[sprite] = 0
+
+    def remove_internal(self, sprite):
+        r = self.spritedict[sprite]
+        if r:
+            self.lostsprites.append(r)
+        del self.spritedict[sprite]
+
+    def has_internal(self, sprite):
+        return sprite in self.spritedict
+
+    def copy(self):
+        """copy a group with all the same sprites
+
+        Group.copy(): return Group
+
+        Returns a copy of the group that is an instance of the same class
+        and has the same sprites in it.
+
+        """
+        return self.__class__(self.sprites())
+
+    def __iter__(self):
+        return iter(self.sprites())
+
+    def __contains__(self, sprite):
+        return self.has(sprite)
+
+    def add(self, *sprites):
+        """add sprite(s) to group
+
+        Group.add(sprite, list, group, ...): return None
+
+        Adds a sprite or sequence of sprites to a group.
+
+        """
+        for sprite in sprites:
+            # It's possible that some sprite is also an iterator.
+            # If this is the case, we should add the sprite itself,
+            # and not the iterator object.
+            if isinstance(sprite, Sprite):
+                if not self.has_internal(sprite):
+                    self.add_internal(sprite)
+                    sprite.add_internal(self)
+            else:
+                try:
+                    # See if sprite is an iterator, like a list or sprite
+                    # group.
+                    self.add(*sprite)
+                except (TypeError, AttributeError):
+                    # Not iterable. This is probably a sprite that is not an
+                    # instance of the Sprite class or is not an instance of a
+                    # subclass of the Sprite class. Alternately, it could be an
+                    # old-style sprite group.
+                    if hasattr(sprite, '_spritegroup'):
+                        for spr in sprite.sprites():
+                            if not self.has_internal(spr):
+                                self.add_internal(spr)
+                                spr.add_internal(self)
+                    elif not self.has_internal(sprite):
+                        self.add_internal(sprite)
+                        sprite.add_internal(self)
+
+    def remove(self, *sprites):
+        """remove sprite(s) from group
+
+        Group.remove(sprite, list, or group, ...): return None
+
+        Removes a sprite or sequence of sprites from a group.
+
+        """
+        # This function behaves essentially the same as Group.add. It first
+        # tries to handle each argument as an instance of the Sprite class. If
+        # that failes, then it tries to handle the argument as an iterable
+        # object. If that failes, then it tries to handle the argument as an
+        # old-style sprite group. Lastly, if that fails, it assumes that the
+        # normal Sprite methods should be used.
+        for sprite in sprites:
+            if isinstance(sprite, Sprite):
+                if self.has_internal(sprite):
+                    self.remove_internal(sprite)
+                    sprite.remove_internal(self)
+            else:
+                try:
+                    self.remove(*sprite)
+                except (TypeError, AttributeError):
+                    if hasattr(sprite, '_spritegroup'):
+                        for spr in sprite.sprites():
+                            if self.has_internal(spr):
+                                self.remove_internal(spr)
+                                spr.remove_internal(self)
+                    elif self.has_internal(sprite):
+                        self.remove_internal(sprite)
+                        sprite.remove_internal(self)
+
+    def has(self, *sprites):
+        """ask if group has a sprite or sprites
+
+        Group.has(sprite or group, ...): return bool
+
+        Returns True if the given sprite or sprites are contained in the
+        group. Alternatively, you can get the same information using the
+        'in' operator, e.g. 'sprite in group', 'subgroup in group'.
+
+        """
+        return_value = False
+
+        for sprite in sprites:
+            if isinstance(sprite, Sprite):
+                # Check for Sprite instance's membership in this group
+                if self.has_internal(sprite):
+                    return_value = True
+                else:
+                    return False
+            else:
+                try:
+                    if self.has(*sprite):
+                        return_value = True
+                    else:
+                        return False
+                except (TypeError, AttributeError):
+                    if hasattr(sprite, '_spritegroup'):
+                        for spr in sprite.sprites():
+                            if self.has_internal(spr):
+                                return_value = True
+                            else:
+                                return False
+                    else:
+                        if self.has_internal(sprite):
+                            return_value = True
+                        else:
+                            return False
+
+        return return_value
+
+    def update(self, *args):
+        """call the update method of every member sprite
+
+        Group.update(*args): return None
+
+        Calls the update method of every member sprite. All arguments that
+        were passed to this method are passed to the Sprite update function.
+
+        """
+        for s in self.sprites():
+            s.update(*args)
+
+    def draw(self, surface):
+        """draw all sprites onto the surface
+
+        Group.draw(surface): return None
+
+        Draws all of the member sprites onto the given surface.
+
+        """
+        sprites = self.sprites()
+        surface_blit = surface.blit
+        for spr in sprites:
+            self.spritedict[spr] = surface_blit(spr.image, spr.rect)
+        self.lostsprites = []
+
+    def clear(self, surface, bgd):
+        """erase the previous position of all sprites
+
+        Group.clear(surface, bg