def __init__(self, pygame, res, surface, size, game_manager): Screen.__init__(self, pygame, res, surface, size) self.game_manager = game_manager self.params_list = Gameplay_Parameters().params_list self.texts['Heading1'] = Text( pygame, res, surface, (self.center_x + 3, 70 + 3), 'Select Game Mode', res.heading1_font, res.BLACK) self.texts['Heading2'] = Text( pygame, res, surface, (self.center_x, 70), 'Select Game Mode', res.heading1_font, res.game_title_text_color) self.texts['Body'] = Text( pygame, res, surface, (self.center_x, 130), 'Choose your game mode', res.body_font, res.body_text_color) self.texts['Game Mode'] = Text( pygame, res, surface, (self.center_x, 240), 'Game mode', res.heading3_font, res.heading3_text_color) self.buttons['Classic'] = Button( pygame, res, surface, (self.center_x - 250, 320), "Classic") self.buttons['Infinite'] = Button( pygame, res, surface, (self.center_x + 000, 320), "Infinite") self.buttons['1v1'] = Button( pygame, res, surface, (self.center_x + 250, 320), "1 vs 1") self.buttons['AI'] = Button( pygame, res, surface, (self.center_x - 250, 400), "AI") self.buttons['Hardcore'] = Button( pygame, res, surface, (self.center_x + 000, 400), "Hardcore") self.buttons['Heist'] = Button( pygame, res, surface, (self.center_x + 250, 400), "Heist") self.buttons['Back'] = Button( pygame, res, surface, (self.center_x, 700), "Back")
def __init__(self, pygame, res, surface, game_manager): Screen.__init__(self, pygame, res, surface) self.game_manager = game_manager self.font = pygame.font.SysFont('cambria', 60) self.font2 = pygame.font.SysFont('cambria', 30) self.buttons['Restart'] = Button(pygame, res, surface, [20, 290, 300, 50], "Restart") self.buttons['Back'] = Button(pygame, res, surface, [20, 360, 300, 50], "Back")
def __init__(self, pygame, res, surface, size): Screen.__init__(self, pygame, res, surface, size) self.texts['Heading1'] = Text( pygame, res, surface, (self.center_x + 3, 70 + 3), 'Credits', res.heading1_font, res.BLACK) self.texts['Heading2'] = Text( pygame, res, surface, (self.center_x, 70), 'Credits', res.heading1_font, res.game_title_text_color) self.texts['Body'] = Text( pygame, res, surface, (self.center_x, 130), 'People who have contributed to this project', res.body_font, res.body_text_color) self.buttons['Contribute'] = Button( pygame, res, surface, (self.center_x, 200), "Contribute") self.buttons['Vineet'] = Button( pygame, res, surface, (self.center_x - 150, 300), "Vineet") self.buttons['Amrit'] = Button( pygame, res, surface, (self.center_x + 150, 300), "Amrit") self.buttons['Kartik'] = Button( pygame, res, surface, (self.center_x - 150, 380), "Kartik") self.buttons['Venturillo'] = Button( pygame, res, surface, (self.center_x + 150, 380), "Venturillo") self.buttons['Shikhar'] = Button( pygame, res, surface, (self.center_x - 150, 460), "Shikhar") self.buttons['Divyang'] = Button( pygame, res, surface, (self.center_x + 150, 460), "Divyang") self.buttons['Azmal'] = Button( pygame, res, surface, (self.center_x - 150, 540), "Azmal") self.buttons['Abhinandan'] = Button( pygame, res, surface, (self.center_x + 150, 540), "Abhinandan") self.buttons['Back'] = Button( pygame, res, surface, (self.center_x, 700), "Back")
def __init__(self, pygame, res, surface, size, gameclock, game_manager): Screen.__init__(self, pygame, res, surface) # set up initial variables self.need_reset = False self.size = size self.result = 0 self.arbit_var = 1 self.coinlist = [] self.gameclock = gameclock self.game_manager = game_manager self.timer = 0 self.cart = Cart(res, self.size, surface, self.game_manager) # set up texts self.time_text = res.basicFont.render('TIMER:', True, res.BLACK, res.WHITE) self.textbox = self.time_text.get_rect(center=(900, 170)) self.point_text = res.basicFont.render('POINTS:', True, res.BLACK, res.WHITE) self.pointbox = self.point_text.get_rect(center=(100, 170)) self.display_time = res.basicFont.render('0', True, res.BLACK, res.WHITE) self.timebox = self.display_time.get_rect(center=(900, 200)) self.score = res.basicFont.render(str(self.cart.points), True, res.BLACK, res.WHITE) self.scorebox = self.score.get_rect(center=(100, 200))
def __init__(self, pygame, res, surface, game_manager): Screen.__init__(self, pygame, res, surface) self.game_manager = game_manager self.buttons['Restart'] = Button( pygame, res, surface, [20, 290, 300, 50], "Restart") self.buttons['Back'] = Button( pygame, res, surface, [20, 360, 300, 50], "Back")
def __init__(self, pygame, res, surface): Screen.__init__(self, pygame, res, surface) self.font = pygame.font.SysFont('cambria', 60) self.font2 = pygame.font.SysFont('cambria', 30) self.buttons['Start Game'] = Button(pygame, res, surface, [20, 150, 300, 50], "Start Game") self.buttons['Tutorial'] = Button(pygame, res, surface, [20, 220, 300, 50], "Tutorial") self.buttons['Settings'] = Button(pygame, res, surface, [20, 290, 300, 50], "Settings") self.buttons['Credits'] = Button(pygame, res, surface, [20, 360, 300, 50], "Credits") self.buttons['Exit'] = Button(pygame, res, surface, [20, 430, 300, 50], "Exit")
def __init__(self, pygame, res, surface, size, gameclock, game_manager): Screen.__init__(self, pygame, res, surface, size) score_x, score_y = res.score_bg_image_size self.images['ScoreBG'] = Image(pygame, res, surface, (0, 0), res.score_bg_image) self.images['TimeBG'] = Image(pygame, res, surface, (self.center_x * 2 - score_x, 0), res.score_bg_image) self.texts['Score'] = Text(pygame, res, surface, (45, score_y / 2), 'Score: 30', res.score_font, res.score_text_color, alignment='left') self.texts['Time'] = Text( pygame, res, surface, (self.center_x * 2 - score_x / 2 - 65, score_y / 2), 'Time: 50', res.score_font, res.score_text_color, alignment='left') self.game_over_text1 = Text(pygame, res, surface, (self.center_x + 3, self.center_y + 3), 'GAME OVER', res.game_title_font, res.BLACK) self.game_over_text2 = Text(pygame, res, surface, (self.center_x, self.center_y), 'GAME OVER', res.game_title_font, res.game_title_text_color) # set up initial variables self.need_reset = False self.size = size self.result = 0 self.coinlist = [] self.gameclock = gameclock self.game_manager = game_manager self.game_manager.score = 0 self.timer = 0 self.cart = Cart(res, self.size, surface, self.game_manager) self.animation_manager = game_manager.animation_manager self.waiting_death_explosion = False self.wait_death_timer = 0 self.wait_death_time = 100 self.spawn_pos_x = self.size[0] / 2 self.death_zone = Death_Zone(self.size) self.res.set_random_bg(self.pygame, self.size)
def __init__(self, pygame, res, surface, game_manager): Screen.__init__(self, pygame, res, surface) self.game_manager = game_manager self.font = pygame.font.SysFont('cambria', 60) self.buttons['Easy'] = Button(pygame, res, surface, [362, 150, 300, 50], "Easy") self.buttons['Medium'] = Button(pygame, res, surface, [362, 220, 300, 50], "Medium") self.buttons['Hard'] = Button(pygame, res, surface, [362, 290, 300, 50], "Hard") self.buttons['Back'] = Button(pygame, res, surface, [362, 360, 300, 50], "Back")
def __init__(self, pygame, res, surface): Screen.__init__(self, pygame, res, surface) self.buttons['Vineet'] = Button( pygame, res, surface, [20, 150, 300, 50], "Vineet") self.buttons['Amrit'] = Button( pygame, res, surface, [20, 220, 300, 50], "Amrit") self.buttons['Venturillo'] = Button( pygame, res, surface, [20, 290, 300, 50], "Venturillo") self.buttons['Divyang'] = Button( pygame, res, surface, [20, 360, 300, 50], "Divyang") self.buttons['Azmal'] = Button( pygame, res, surface, [20, 430, 300, 50], "Azmal") self.buttons['Abhinandan'] = Button( pygame, res, surface, [20, 500, 300, 50], "Abhinandan") self.buttons['Back'] = Button( pygame, res, surface, [20, 640, 300, 50], "Back")
def __init__(self, pygame, res, surface, size): Screen.__init__(self, pygame, res, surface, size) self.texts['Heading1'] = Text(pygame, res, surface, (self.center_x + 3, 70 + 3), 'Settings', res.heading1_font, res.BLACK) self.texts['Heading2'] = Text(pygame, res, surface, (self.center_x, 70), 'Settings', res.heading1_font, res.game_title_text_color) self.texts['Body'] = Text(pygame, res, surface, (self.center_x, 130), 'Edit game settings here', res.body_font, res.body_text_color) self.buttons['Back'] = Button(pygame, res, surface, (self.center_x, 700), "Back")
def __init__(self, pygame, res, surface, size): Screen.__init__(self, pygame, res, surface, size) self.texts['Heading1'] = Text(pygame, res, surface, (self.center_x + 3, 70 + 3), 'Tutorial', res.heading1_font, res.BLACK) self.texts['Heading2'] = Text(pygame, res, surface, (self.center_x, 70), 'Tutorial', res.heading1_font, res.game_title_text_color) self.texts['Body'] = Text(pygame, res, surface, (self.center_x, 130), 'How to play the game', res.body_font, res.body_text_color) self.buttons['Back'] = Button(pygame, res, surface, (self.center_x, 700), "Back")
def __init__(self, pygame, res, surface, size, game_manager): Screen.__init__(self, pygame, res, surface, size) self.game_manager = game_manager self.params_list = Gameplay_Parameters().params_list self.texts['Heading1'] = Text(pygame, res, surface, (self.center_x + 3, 70 + 3), 'Introduction', res.heading1_font, res.BLACK) self.texts['Heading2'] = Text(pygame, res, surface, (self.center_x, 70), 'Introduction', res.heading1_font, res.game_title_text_color) self.texts['Body'] = Text(pygame, res, surface, (self.center_x, 130), 'How to play this game mode', res.body_font, res.body_text_color) self.buttons_classic = {} self.buttons_others = {} self.buttons_classic['Easy'] = Button(pygame, res, surface, (self.center_x - 250, 620), "Easy") self.buttons_classic['Medium'] = Button(pygame, res, surface, (self.center_x + 000, 620), "Medium") self.buttons_classic['Hard'] = Button(pygame, res, surface, (self.center_x + 250, 620), "Hard") self.buttons_others['Start'] = Button(pygame, res, surface, (self.center_x, 620), "Start") self.buttons_classic['Back'] = Button(pygame, res, surface, (self.center_x, 700), "Back") self.buttons_others['Back'] = Button(pygame, res, surface, (self.center_x, 700), "Back")
def __init__(self, pygame, res, surface): Screen.__init__(self, pygame, res, surface) self.font = pygame.font.SysFont('cambria', 60) self.font2 = pygame.font.SysFont('cambria', 30) self.buttons['Vineet'] = Button(pygame, res, surface, [20, 150, 300, 50], "Vineet") self.buttons['Amrit'] = Button(pygame, res, surface, [20, 220, 300, 50], "Amrit") self.buttons['Venturillo'] = Button(pygame, res, surface, [20, 290, 300, 50], "Venturillo") self.buttons['Divyang'] = Button(pygame, res, surface, [20, 360, 300, 50], "Divyang") self.buttons['Azmal'] = Button(pygame, res, surface, [20, 430, 300, 50], "Azmal") self.buttons['Abhinandan'] = Button(pygame, res, surface, [20, 500, 300, 50], "Abhinandan") self.buttons['Gitter'] = Button(pygame, res, surface, [20, 570, 300, 50], "Gitter") self.buttons['Back'] = Button(pygame, res, surface, [20, 640, 300, 50], "Back")
def __init__(self, pygame, res, surface, game_manager): Screen.__init__(self, pygame, res, surface) self.game_manager = game_manager self.buttons['Classic'] = Button(pygame, res, surface, [20, 170, 210, 50], "Classic") self.buttons['Infinite'] = Button(pygame, res, surface, [20, 240, 210, 50], "Infinite") self.buttons['1v1'] = Button(pygame, res, surface, [20, 310, 210, 50], "1 vs 1") self.buttons['Easy'] = Button(pygame, res, surface, [20, 520, 180, 50], "Easy") self.buttons['Medium'] = Button(pygame, res, surface, [240, 520, 180, 50], "Medium") self.buttons['Hard'] = Button(pygame, res, surface, [460, 520, 180, 50], "Hard") self.buttons['Back'] = Button(pygame, res, surface, [20, 680, 300, 50], "Back")
def __init__(self, pygame, res, surface, size): Screen.__init__(self, pygame, res, surface, size) self.texts['GameTitleShadow1'] = Text(pygame, res, surface, (self.center_x + 9, 100 + 9), 'Coin Fall', res.game_title_font, res.BLACK) self.texts['GameTitleShadow2'] = Text(pygame, res, surface, (self.center_x + 6, 100 + 6), 'Coin Fall', res.game_title_font, res.BLACK) self.texts['GameTitleShadow3'] = Text(pygame, res, surface, (self.center_x + 3, 100 + 3), 'Coin Fall', res.game_title_font, res.BLACK) self.texts['GameTitle'] = Text(pygame, res, surface, (self.center_x, 100), 'Coin Fall', res.game_title_font, res.game_title_text_color) self.texts['Body1'] = Text(pygame, res, surface, (self.center_x, 190), 'Open-source coin collection game', res.body_font, res.body_text_color) self.texts['Body2'] = Text(pygame, res, surface, (self.center_x, 220), 'Made with Python and Pygame', res.body_font, res.body_text_color) self.buttons['Start'] = Button(pygame, res, surface, (self.center_x, 380), "Start") self.buttons['Tutorial'] = Button(pygame, res, surface, (self.center_x, 460), "Tutorial") self.buttons['Settings'] = Button(pygame, res, surface, (self.center_x, 540), "Settings") self.buttons['Credits'] = Button(pygame, res, surface, (self.center_x, 620), "Credits") self.buttons['Exit'] = Button(pygame, res, surface, (self.center_x, 700), "Exit")
def __init__(self, pygame, res, surface, size, game_manager): Screen.__init__(self, pygame, res, surface, size) self.game_manager = game_manager self.texts['Heading1'] = Text(pygame, res, surface, (self.center_x + 3, 70 + 3), 'Game Over', res.heading1_font, res.BLACK) self.texts['Heading2'] = Text(pygame, res, surface, (self.center_x, 70), 'Game Over', res.heading1_font, res.game_title_text_color) self.texts['Body'] = Text(pygame, res, surface, (self.center_x, 130), 'Game score and performance', res.body_font, res.body_text_color) self.buttons['Restart'] = Button(pygame, res, surface, (self.center_x, 290), "Restart") self.buttons['Back'] = Button(pygame, res, surface, (self.center_x, 700), "Back")
def __init__(self, pygame, res, surface, size, gameclock, game_manager): Screen.__init__(self, pygame, res, surface, size) score_x, score_y = res.score_bg_image_size self.images['ScoreBG'] = Image(pygame, res, surface, (0, 0), res.score_bg_image) self.images['TimeBG'] = Image(pygame, res, surface, (self.center_x * 2 - score_x, 0), res.score_bg_image) self.texts['Score'] = Text(pygame, res, surface, (45, score_y / 2), 'Score: 30', res.score_font, res.score_text_color, alignment='left') self.texts['Time'] = Text( pygame, res, surface, (self.center_x * 2 - score_x / 2 - 65, score_y / 2), 'Time: 50', res.score_font, res.score_text_color, alignment='left') # set up initial variables self.need_reset = False self.size = size self.result = 0 self.arbit_var = 1 self.coinlist = [] self.gameclock = gameclock self.game_manager = game_manager self.timer = 0 self.cart = Cart(res, self.size, surface, self.game_manager)
def __init__(self, pygame, res, surface): Screen.__init__(self, pygame, res, surface) self.font = pygame.font.SysFont('cambria', 60) self.font2 = pygame.font.SysFont('cambria', 30) self.buttons['Back'] = Button(pygame, res, surface, [20, 360, 300, 50], "Back")
def __init__(self, pygame, res, surface): Screen.__init__(self, pygame, res, surface) self.buttons['Back'] = Button( pygame, res, surface, [20, 360, 300, 50], "Back")