Beispiel #1
0
# Screen objects #
##################
end_game_screen = Screen(
    name='end_game',
    main=end_game,
    firstLoad=[],
    surfaces={
        'gameover': {
            'frame': Frame(x=0, y=0, w=1800, h=1080),
            'try_again': {
                'type': 'button',
                'frame': Frame(x=347, y=708, w=507, h=140),
                'imageData': {
                    'frame': Frame(x=347, y=708, w=507, h=140)
                },
                'action': Runclass(run=PlayerData.new)
            },
            'mainmenu': {
                'type': 'button',
                'frame': Frame(x=946, y=708, w=507, h=140),
                'imageData': {
                    'frame': Frame(x=946, y=708, w=507, h=140)
                },
                'action': Switchscreen(type='back', screen='mainmenu')
            },
        },
        'win': {
            'frame': Frame(x=0, y=0, w=1800, h=1080),
            'background': {
                'type': 'object',
                'frame': Frame(x=0, y=0, w=1800, h=1080),
Beispiel #2
0
        }
    },

    surfaces = {
        'options': {
            'frame': Frame(x=0, y=0, w=1800, h=1080),
            'background': {
                'type': 'object',
                'frame': Frame(x=0, y=0, w=1800, h=1080),
                'clickSound': None
            },
            'nickname': {
                'type': 'textfield',
                'frame': Frame(x=747, y=341, w=925, h=140),
                'imageData': {'frame': Frame(x=747, y=341, w=925, h=140)},
                'action': Runclass(run=new_game.textfield_selected),
                'data': {
                    'text': Text (
                        frame = Frame(x=747, y=341, w=925, h=140),
                        text = 'Benedict',
                        format = TextFormat(fontSize=116, align='center', pos='center', colour=PgEss.colour.white),
                        validation = TextValidate(regex='[\w\s]{1,16}', invalidPrompt='Player nickname should be between 1 and 16 character\'s long.')
                    ),
                },
            },
            'difficulty': {
                'type': 'text',
                'frame': Frame(x=1008, y=636, w=405, h=140),
                'imageData': {'frame': Frame(x=1008, y=636, w=405, h=140)},
                'selectable': False,
                'data': {
Beispiel #3
0
             format = TextFormat(fontSize=52, align='left', pos='center', colour=PgEss.colour.green)
         ),
         'elixir': Text (
             frame = Frame(x=1099, y=140, w=307, h=59),
             prefix = 'Elixir: ',
             text = '10',
             format = TextFormat(fontSize=52, align='left', pos='center', colour=PgEss.colour.purple)
         ),
     },
 },
 'shield': {
     'type': 'button',
     'frame': Frame(x=609, y=301, w=527, h=300),
     'imageData': {'frame': Frame(x=609, y=301, w=527, h=300)},
     'overlayDataFrame': True,
     'action': Runclass(run=Store.checkBuy, parameters={'weapon': 'shield'}),
     'data': {
         'object': Text (
             frame = Frame(x=120, y=25, w=237, h=83),
             text = 'Shield',
             format = TextFormat(fontSize=76, align='left', pos='center', colour=PgEss.colour.white)
         ),
         'price': Text (
             frame = Frame(x=357, y=33, w=83, h=69),
             text = '20',
             format = TextFormat(fontSize=62, align='right', pos='center', colour=PgEss.colour.purple)
         ),
         'gain_1': Text (
             frame = Frame(x=25, y=112, w=349, h=75),
             prefix = 'Defence: ', text = '+ 2',
             format = TextFormat(fontSize=68, align='left', pos='center', colour=PgEss.colour.blue)
Beispiel #4
0
##################
# Screen objects #
##################
saves_screen = Screen (
    name = 'saves',
    main = saves,

    keyboard = {
        'back': {
            'keys': [27],
            'action': Switchscreen(type='back', screen='mainmenu')
        },
        'page_back': {
            'keys': [1073741904],
            'action': Runclass(run=PlayerSaves.updateList, parameters={'page': -1})
        },
        'page_next': {
            'keys': [1073741903],
            'action': Runclass(run=PlayerSaves.updateList, parameters={'page': 1})
        },
    },

    surfaces = {
        'board': {
            'frame': Frame(x=0, y=0, w=1800, h=1080),
            'alpha': True,
            'back': {
                'type': 'button',
                'frame': Frame(x=141, y=58, w=132, h=103),
                'imageData': {'frame': Frame(x=141, y=58, w=132, h=103)},
Beispiel #5
0
        # Disable sensing orb
        screens.game.in_open.sense_orb.switchState('Disabled',
                                                   withDisplay=False)

        # Remove orb from map
        Grid.tiles[Player.orb.row][Player.orb.column].sprites.remove('orb')
        screens.game.map.display(withItems=['grid'], refresh=True)

        # Play cool sound
        sound.orb_take.play()

        # Return to selection menu
        Orb.back()

    @staticmethod
    def back():
        # Unload orb screen
        if Player.weapon.have('orb'): screens.game.found_orb.unload()
        else: screens.game.no_orb.unload()

        # Check for attack
        if Attack.haveEnemy(): return

        # Load back selection screen
        screens.game.in_open.display()


# Add change orb to gameEvent queue
gameEvent.orb_change.addQueue(Runclass(run=Orb.changeLocation))