Esempio n. 1
0
    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, 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, 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, size, gameclock, game_manager):
        Game_screen.__init__(self, pygame, res, surface, size, gameclock,
                             game_manager)

        score_x, score_y = res.score_bg_image_size

        self.images = {}
        self.texts = {}

        self.images['ScoreBG_Player1'] = Image(pygame, res, surface, (0, 0),
                                               res.score_bg_image)

        self.images['ScoreBG_Player2'] = Image(pygame, res, surface,
                                               (0, score_y),
                                               res.score_bg_image)

        self.texts['Score_Player1'] = Text(pygame,
                                           res,
                                           surface, (45, score_y / 2),
                                           'Player 1: 30',
                                           res.score_font,
                                           res.score_text_color,
                                           alignment='left')

        self.texts['Score_Player2'] = Text(pygame,
                                           res,
                                           surface,
                                           (45, score_y + score_y / 2),
                                           'Player 2: 30',
                                           res.score_font,
                                           res.score_text_color,
                                           alignment='left')

        self.images['TimeBG'] = Image(pygame, res, surface,
                                      (self.center_x * 2 - score_x, 0),
                                      res.score_bg_image)

        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.cart_player1 = Cart_One_V_One(res, size, surface, game_manager,
                                           res.cart_player1_img,
                                           'horizontal_player1', -100)
        self.cart_player2 = Cart_One_V_One(res, size, surface, game_manager,
                                           res.cart_player2_img,
                                           'horizontal_player2', 100)
        self.score_player1 = 0
        self.score_player2 = 0
Esempio n. 5
0
    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")
Esempio n. 6
0
    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")
Esempio n. 7
0
    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")
Esempio n. 8
0
    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")
Esempio n. 9
0
    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)
Esempio n. 10
0
    def __init__(self, pygame, res, surface, size, gameclock, game_manager):
        Classic_Game_Screen.__init__(self, pygame, res, surface, size,
                                     gameclock, game_manager)

        score_x, score_y = res.score_bg_image_size

        self.images['Misses_BG'] = Image(pygame, res, surface, (0, score_y),
                                         res.score_bg_image)

        self.texts['Misses'] = Text(pygame,
                                    res,
                                    surface, (45, score_y + score_y / 2),
                                    'Misses: 0',
                                    res.score_font,
                                    res.score_text_color,
                                    alignment='left')

        self.misses_in_row = 0
Esempio n. 11
0
    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")