コード例 #1
0
    def __init__(self, state):
        GameScreen.__init__(self, state)
        print("- Create Group info Screen")
        self.titleFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 72)
        self.itemFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 48)
        self.menuWidth = 0

        self.menuItems = [
            {
                'title': 'Press ESC to return MENU'
            },
            {
                'title': 'Tran Minh Duc 18127027',
            },
            {
                'title': 'Nguyen Vu Thu Hien 18127004',
            },
            {
                'title': 'Ngo Thanh Phuong Thai 18127208 ',
            },
            {
                'title': 'Tran Quoc Tuan 18127246',
            },
        ]
        for item in self.menuItems:
            surface = self.itemFont.render(item['title'], True, (200, 0, 0))
            self.menuWidth = max(self.menuWidth, surface.get_width())
            item['surface'] = surface

        self.currentMenuItem = 0
        self.menuCursor = pygame.image.load(PATH_IMAGE + "icon.png")
        self.backgroundImage = pygame.image.load(PATH_IMAGE + "bg.jpg")
コード例 #2
0
    def __init__(self, state):
        GameScreen.__init__(self, state=state)
        self.titleFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 72)
        self.itemFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 48)

        print("Created [level 3 game screen]")
        self.run()
コード例 #3
0
    def __init__(self, state):
        GameScreen.__init__(self, state=state)
        self.titleFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 72)
        self.itemFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 48)

        print("Created [second level screen]")
        self.tile_manager = SecondLevelManager()
コード例 #4
0
    def __init__(self, state):
        GameScreen.__init__(self, state)
        print("- Create Play Game Screen")

        self.titleFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 72)
        self.itemFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 48)
        self.player = None
        self.load_data()
        self.new()
コード例 #5
0
    def __init__(self, state):
        GameScreen.__init__(self, state)
        print("- Create Menu Screen")
        self.titleFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 72)
        self.itemFont = pygame.font.Font(
            PATH_ASSETS + "font/BD_Cartoon_Shout.ttf", 48)
        self.menuWidth = 0

        self.menuItems = [
            {
                'title': 'Level 1',
                'action': EScreenState.LEVEL_1,
            },
            {
                'title': 'Level 2',
                'action': EScreenState.LEVEL_2
            },
            {
                'title': 'Level 3',
                'action': EScreenState.LEVEL_3,

            },
            {
                'title': 'Level 4',
                'action': EScreenState.LEVEL_4
            },
            {
                'title': 'Group Information',
                'action': EScreenState.GROUP

            },
            {
                'title': 'Exit'
            }
        ]
        for item in self.menuItems:
            surface = self.itemFont.render(item['title'], True, (200, 0, 0))
            self.menuWidth = max(self.menuWidth, surface.get_width())
            item['surface'] = surface

        self.currentMenuItem = 0
        self.menuCursor = pygame.image.load(PATH_IMAGE + "icon.png")
        self.backgroundImage = pygame.image.load(PATH_IMAGE + "bg.jpg")