version 1.3, 2011/11/03 22:13:19
|
version 1.4, 2011/11/05 02:38:17
|
Line 126 class Goals( pygame.sprite.Sprite ):
|
Line 126 class Goals( pygame.sprite.Sprite ):
|
self.fly = 0 |
self.fly = 0 |
self.gator = 0 |
self.gator = 0 |
|
|
|
class frog( pygame.sprite.Sprite): |
|
def __init__( self ): |
|
pygame.sprite.Sprite.__init( self ) |
|
pos = [0, 0] |
|
oldPos = [0, 0] |
|
direction = 0 |
|
location = 0 |
|
hopCount = 0 |
|
currentRow = 0 |
|
alive = 1 |
|
riding = 0 |
|
ridingType = 0 |
|
deathType = 0 |
|
deathCount = 0 |
|
|
def main( ): |
def main( ): |
pygame.mixer.init( ) |
pygame.mixer.init( ) |
pygame.mixer.pre_init( 44100, -16, 2, 2048 ) |
pygame.mixer.pre_init( 44100, -16, 2, 2048 ) |
Line 144 def beginGame( ):
|
Line 159 def beginGame( ):
|
next_heartbeat = 0 |
next_heartbeat = 0 |
done = 0 |
done = 0 |
|
|
|
if loadMedia( ) <= 0: |
|
print "Error: Failed to load graphics and audio!\n" |
|
return |
|
|
drawBackground( ) |
drawBackground( ) |
|
|
if DEBUG: print "D: Starting main game loop" |
if DEBUG: print "D: Starting main game loop" |
Line 232 def drawBackground( ):
|
Line 251 def drawBackground( ):
|
screen.blit( background_image, ( 0, 0 ) ) |
screen.blit( background_image, ( 0, 0 ) ) |
pygame.display.flip( ) |
pygame.display.flip( ) |
|
|
|
def loadMedia( ): |
|
print "D: Loading media" |
|
return 1 |
|
|
def loadImage( filename, colorKey = None ): |
def loadImage( filename, colorKey = None ): |
fullname = os.path.join( 'images', filename ) |
fullname = os.path.join( 'images', filename ) |
|
|