Back to index

freevial  1.2
Public Member Functions
freevial.Freevial Class Reference

List of all members.

Public Member Functions

def __init__
def inici
def juguem

Detailed Description

Definition at line 55 of file freevial.py.


Constructor & Destructor Documentation

Definition at line 57 of file freevial.py.

00057 
00058        def __init__( self ):
00059               
00060               Global.game = GlobalVar()
00061               
00062               Global.game.screen = ''
00063               Global.game.rounds = 0
00064               
00065               Global.game.teams = []
00066               
00067               Global.game.current_team = 0
00068               Global.game.sfc_credits = ''
00069        
       

Member Function Documentation

def freevial.Freevial.inici (   self)

Definition at line 70 of file freevial.py.

00070 
00071        def inici( self ):
00072               
00073               # inicialize presentation surface
00074               Global.game.screen = pygame.display.set_mode( ( Global.screen_x, Global.screen_y), HWSURFACE, 32)
00075               pygame.display.set_caption('Freevial')
00076               pygame.display.set_icon( loadImage('freevial.png') )
00077               
00078               if not Global.DEBUG_MODE:
00079                      pygame.mouse.set_visible( False )
00080 
00081                      if Global.FS_MODE:
00082                             pygame.display.toggle_fullscreen()
00083               
00084               # inicialize sound and text systems
00085               if not (Global.SOUND_MUTE and Global.MUSIC_MUTE):
00086                      try:
00087                             pygame.mixer.pre_init(44100, -16, 2, 2048)
00088                             pygame.mixer.init()
00089                      except pygame.error, message:
00090                             print _('Sound initialization failed. %s' % message)
00091                             Global.SOUND_MUTE = True
00092                             Global.MUSIC_MUTE = True
00093               
00094               pygame.font.init()
00095               
00096               Global.game.sfc_credits = createHelpScreen( 'credits', alternate_text = True )
00097               
00098               initTextos()
00099               
00100               # initialize joystick, if there's one
00101               pygame.joystick.init()
00102               if pygame.joystick.get_count():
00103                      pygame.joystick.Joystick( 0 ).init()
00104               
00105               # initialize skin system
00106               Global.game.skin = Skin()
00107               Global.game.max_teams = Global.game.skin.configGetInt( 'max_teams', domain='game' )
00108               for num in range( 0, Global.game.max_teams ): Global.game.teams.append( Equip() )
00109        
       

Here is the call graph for this function:

Here is the caller graph for this function:

def freevial.Freevial.juguem (   self)

Definition at line 110 of file freevial.py.

00110 
00111        def juguem( self ):
00112               
00113               self.inici()
00114               
00115               score = roda = fespregunta = None
00116 
00117               while 1:
00118                      
00119                      if not score: score = Score( Global.game )
00120                      
00121                      Global.game.current_team = score.juguem()
00122                      
00123                      if Global.game.current_team != -1:
00124                             
00125                             Global.game.rounds += 1            
00126                             
00127                             if not roda: roda = Roda( Global.game )
00128                             
00129                             resultat = roda.juguem( )
00130                             
00131                             if resultat != -1:
00132                                           
00133                                    Global.game.teams[ Global.game.current_team ].preguntes_tot[ resultat - 1 ] += 1           
00134                                    
00135                                    if not fespregunta:  fespregunta = Preguntador( Global.game )
00136                                    
00137                                    resultat = fespregunta.juguem( resultat ) 
00138                                    
00139                                    if resultat > -1:
00140                                           Global.game.teams[ Global.game.current_team ].preguntes_ok[ resultat - 1 ] += 1
00141                                           Global.game.teams[ Global.game.current_team ].punts += 1
00142                                           
00143                                           fig_abans = Global.game.teams[ Global.game.current_team].figureta
00144                                           Global.game.teams[ Global.game.current_team].activaCategoria( resultat ) 
00145                                           
00146                                           if fig_abans != 63 and Global.game.teams[ Global.game.current_team].figureta == 63:
00147                                                  Global.game.teams[ Global.game.current_team].punts += 2
00148                                    else:
00149                                           Global.game.teams[ Global.game.current_team ].errors += 1
00150                                           
00151                                    Global.game.current_team = seguentEquipActiu( Global.game.teams, Global.game.current_team )
00152                      else:
00153                             sys.exit()
00154 

Here is the call graph for this function:


The documentation for this class was generated from the following file: