本文整理汇总了Python中gamestate.GameState.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python GameState.__init__方法的具体用法?Python GameState.__init__怎么用?Python GameState.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gamestate.GameState
的用法示例。
在下文中一共展示了GameState.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, manager):
GameState.__init__(self, manager)
sys_font = Font(get_default_font(), options.font_size)
self.message1 = sys_font.render("Andrew's Bitchin' Yars' Revenge Clone",
True, options.white)
self.message2 = sys_font.render("Press shoot button (space) to start.",
True, options.white)
示例2: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, manager, score, lives, next_state):
GameState.__init__(self, manager)
sys_font = Font(get_default_font(), options.font_size)
self.score_text = sys_font.render(str(score), True, options.white)
self.lives_text = sys_font.render(str(lives), True, options.white)
self.next_state = next_state
示例3: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, gsm, view):
"""Initialisation des ressources et des modèles (une seule fois)"""
GameState.__init__(self, gsm, view)
self.areas = {}
self.area = None
self.description_hash = {}
self.default_verb = 'look_at'
self._action_subject = models.ActionSubject(self, self.default_verb)
self._complement = None # idem
self.inventory = models.Inventory(self)
示例4: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, parent):
GameState.__init__(self, parent)
# White background
self.g_background = GLSpriteGroup()
background = ColorBackground(0.0, 0.0, 800.0, 600.0, (255, 255, 255))
self.g_background.add(background)
self.timer = 1500
self.menu_added = False
self.background_alpha = 1.0
示例5: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, settings, platformer_instance):
GameState.__init__(self, settings)
self.platformer_instance = platformer_instance
self.keystate.update({
'left':False,
'right':False,
'jump':False,
'up':False,
'down':False,
})
self.font = pygame.font.Font(pygame.font.match_font("consolas", bold=True), 24)
示例6: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, gc):
"""Initialisation des ressources et des modèles qui ne doivent être initialisés qu'une seule fois"""
GameState.__init__(self, gc)
self.areas = {}
self.area = None
self.description_hash = {}
# self.default_verb = 'look_at' # inside set_query_mode()
self._verb = None # may not be needed
self._complement = None
self.set_query_mode(False) # ok??
self.inventory = Inventory()
#Affichage de l'inventaire
self.view.fillInventoryLayer(self.inventory)
self.set_inventory_layer()
示例7: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, settings):
GameState.__init__(self, settings)
self.selected_color = SELECTED_COLOR
self.unselected_color = UNSELECTED_COLOR
self.background_color = BACKGROUND_COLOR
self.title_image = self.get_title_text_image(options.title(), options.standard_size()[0] - 2*MENU_ICING)
self.option_names = ["start full run", "grind single level", "edit levels", "select level pack", "settings"]
self.option_actions = [
lambda: self._launch_full_run_mode(),
lambda: self.state_manager.set_current_state(GameStateManager.SELECT_SINGLE_LEVEL_STATE),
lambda: None,
lambda: None,
lambda: None
]
self.selected_index = 0
self.option_text_images = []
for i in range(0, len(self.option_names)):
name = self.option_names[i]
c = self.unselected_color if i != self.selected_index else self.selected_color
self.option_text_images.append(NORMAL_TEXT_FONT.render(name, True, c))
示例8: __init__
# 需要导入模块: from gamestate import GameState [as 别名]
# 或者: from gamestate.GameState import __init__ [as 别名]
def __init__(self, manager):
"""manager is required to be a child of GameManager with these functions:
-kill_player()
-next_level()
-add_score(amount)
-give_energy(amount)
-spend_energy(amount)
-give_life()
"""
GameState.__init__(self, manager)
self.player = Ship(*opt.player_args)
self.enemy = EnemyBase(opt.mover_args, opt.spinner_args, opt.shooter_args, self.player)
self.shield = EnemyShield(self.enemy, opt.shield_filename, formation, formation_center)
self.hbullet = HomingBullet(opt.homer_filename, self.player, opt.homer_speed)
self.cannon = Cannon(opt.deactivated_cannon_args, opt.standby_cannon_args,
opt.firing_cannon_args, self.player)
self.ion_field = IonField(*opt.ion_field_args)
self.player_bullets = Group()
self.reset_positions()