예제 #1
0
    def __init__(self, screen, theme_channel, buzzers):

        self.SCREEN = screen
        self.THEME_CHANNEL = theme_channel
        self.BUZZERS = buzzers

        # play if channel inactive
        if not theme_channel.get_busy():
            theme_channel.play(THEME_SOUND, -1)

        # menu state
        self.charsel_state = False

        # info state
        self.input_state = bool(buzzers)
        self.sfx_state = True
        self.speech_state = True
        self.music_state = True
        self.new_game = False
        self.check_buzzers = False

        # misc variables
        self.cursor_loc = 0
        self.game_date = None
        self.charsel_dimension = [((NUM_SPRITES + 1) / 2),
                                  (NUM_SPRITES + 1) % 2]

        # which players are active
        self.active_players = [-1, -1, -1, -1]
        self.player_cursor_pos = [0, 0, 0, 0]
        self.char_selected = [False, True, True, True]

        # text surfaces
        self.start_text_surface = None
        self.newgame_text_surface = None
        self.check_buzzers_surface = None
        self.sfx_text_surface = None
        self.speech_text_surface = None
        self.music_text_surface = None
        self.gamedate_text_surface = None

        # cursor surfaces
        self.cursor_surfaces = [
            gen.cursor_surface(180, 120, WHITE, "P1"),
            gen.cursor_surface(180, 120, WHITE, "P2"),
            gen.cursor_surface(180, 120, WHITE, "P3"),
            gen.cursor_surface(180, 120, WHITE, "P4")
        ]
        self.border_surface = gen.cursor_surface(180, 120, YELLOW)

        # buzzer status surface
        self.buzzer_prompt_surface = gen.text_surface("BUZZERS FOUND: ", 175,
                                                      50, 20)
        self.buzzer_status_surface = self.__get_buzzer_status_surface()

        # initial blit to screen
        self.__update_display()
예제 #2
0
파일: menu.py 프로젝트: jesmith0/JeoPyrdy
    def __init__(self, screen, theme_channel, buzzers):

        self.SCREEN = screen
        self.THEME_CHANNEL = theme_channel
        self.BUZZERS = buzzers

        # play if channel inactive
        if not theme_channel.get_busy():
            theme_channel.play(THEME_SOUND, -1)

        # menu state
        self.charsel_state = False

        # info state
        self.input_state = bool(buzzers)
        self.sfx_state = True
        self.speech_state = True
        self.music_state = True
        self.new_game = False
        self.check_buzzers = False

        # misc variables
        self.cursor_loc = 0
        self.game_date = None
        self.charsel_dimension = [((NUM_SPRITES + 1) / 2), (NUM_SPRITES + 1) % 2]

        # which players are active
        self.active_players = [-1, -1, -1, -1]
        self.player_cursor_pos = [0, 0, 0, 0]
        self.char_selected = [False, True, True, True]

        # text surfaces
        self.start_text_surface = None
        self.newgame_text_surface = None
        self.check_buzzers_surface = None
        self.sfx_text_surface = None
        self.speech_text_surface = None
        self.music_text_surface = None
        self.gamedate_text_surface = None

        # cursor surfaces
        self.cursor_surfaces = [
            gen.cursor_surface(180, 120, WHITE, "P1"),
            gen.cursor_surface(180, 120, WHITE, "P2"),
            gen.cursor_surface(180, 120, WHITE, "P3"),
            gen.cursor_surface(180, 120, WHITE, "P4"),
        ]
        self.border_surface = gen.cursor_surface(180, 120, YELLOW)

        # buzzer status surface
        self.buzzer_prompt_surface = gen.text_surface("BUZZERS FOUND: ", 175, 50, 20)
        self.buzzer_status_surface = self.__get_buzzer_status_surface()

        # initial blit to screen
        self.__update_display()
예제 #3
0
파일: game.py 프로젝트: jesmith0/jeopyrdy
    def __init__(self, screen, lib, active_players, sfx_on, speech_on,
                 input_type):

        # STATIC VARIABLES
        self.SCREEN = screen
        self.LIB = lib
        self.SFX_ON = sfx_on
        self.SPEECH_ON = speech_on
        self.INPUT_TYPE = input_type
        self.NUM_ACTIVE = len(active_players)

        self.clear_events_flag = False

        # STATE VARIABLES
        self.state = state.State(sfx_on)
        self.cursor_loc = [0, 0]
        self.cur_round = 0
        self.cur_block = lib[0][0][0]
        self.game_over = False
        self.clue_read = False
        self.play_toasty = False

        self.currently_playing = None

        # TOASTY VARIABLES
        self.toasty_x = 0
        self.toasty_step = 0
        self.toasty = gen.char_surface(-1)

        # SKIP VARIABLES
        self.skip_arr = [False, False, False, False]

        # PLAYER OBJECTS
        self.players = util.init_player_objects(active_players)

        # GENERATE STATIC SURFACES
        self.board_surf = gen.board_surface()  # returns a blank board surface
        self.blank_board_surf = gen.board_surface(
        )  # returns a blank board surface (kept blank)
        self.cursor_surf = gen.cursor_surface()  # returns a cursor surface
        self.value_surfs = gen.value_surfaces(
        )  # returns a list of two lists of value surfaces

        # SOUND CHANNELS
        self.fj_channel = pygame.mixer.Channel(2)
        self.res_channel = None

        # SET DAILY DOUBLES
        self.__set_dailydoubles()

        # SYSTEM PROCESSES
        self.speech_popen = None

        # PLAY SOUNDS
        if self.SFX_ON: BOARDFILL_SOUND.play()

        # INITIAL UPDATE
        self.update()
예제 #4
0
파일: game.py 프로젝트: jesmith0/JeoPyrdy
	def __init__(self, screen, lib, active_players, pyttsx_engine, sfx_on, speech_on, input_type):
	
		# STATIC VARIABLES
		self.SCREEN = screen
		self.LIB = lib
		self.SFX_ON = sfx_on
		self.SPEECH_ON = speech_on
		self.INPUT_TYPE = input_type
		
		# TTS OBJECT
		self.PYTTSX_ENGINE = pyttsx_engine
		
		# STATE VARIABLES
		self.state = state.State(sfx_on)
		self.cursor_loc = [0,0]
		self.cur_round = 0
		self.cur_block = lib[0][0][0]
		self.game_over = False
		self.clue_read = False
		
		# PLAYER OBJECTS
		self.players = util.init_player_objects(active_players)
		
		# GENERATE STATIC SURFACES
		self.board_surf = gen.board_surface()			# returns a blank board surface
		self.blank_board_surf = gen.board_surface()		# returns a blank board surface (kept blank)
		self.cursor_surf = gen.cursor_surface()			# returns a cursor surface
		self.value_surfs = gen.value_surfaces()			# returns a list of two lists of value surfaces
		
		# SOUND CHANNELS
		self.fj_channel = None
		self.res_channel = None
		
		# SET DAILY DOUBLES
		self.__set_dailydoubles()
		
		# PLAY SOUNDS
		if self.SFX_ON: BOARDFILL_SOUND.play()
		
		# INITIAL UPDATE
		self.update()