def __init__(self, director, pausedScene, title='Warning!', message='Message', tooltip='Press here to continue'): Scene.__init__(self, director) self.bluredBackground = None self.b = 1 self.pausedScene = pausedScene layer = Layer(director) backgroundImage = Resources.load_image("message_box.png") buttonImage = Resources.load_image("message_box_button.png") buttonWidth = 372 style = MessageBox.createMessageBoxStyle(backgroundImage, buttonImage, buttonWidth) self.messageBox = MessageBox.MessageBox( self.director, (SCREEN_W / 2 - style['bg'].get_width() / 2, SCREEN_H / 2 - style['bg'].get_height() / 2), style, True) self.messageBox.button.onMouseDown = lambda: self.popScene() self.messageBox.title = title self.messageBox.message = message self.messageBox.tooltip = tooltip layer.append(self.messageBox) self.layers.append(layer)
def __init__(self, director, pausedScene, title='Warning!', message='Message', tooltip='Press here to continue'): Scene.__init__(self, director) self.bluredBackground = None self.b = 1 self.pausedScene = pausedScene layer = Layer(director) backgroundImage = Resources.load_image("message_box.png") buttonImage = Resources.load_image("message_box_button.png") buttonWidth = 372 style = MessageBox.createMessageBoxStyle( backgroundImage, buttonImage, buttonWidth) self.messageBox = MessageBox.MessageBox( self.director, (SCREEN_W / 2 - style['bg'].get_width() / 2, SCREEN_H / 2 - style['bg'].get_height() / 2), style, True) self.messageBox.button.onMouseDown = lambda: self.popScene() self.messageBox.title = title self.messageBox.message = message self.messageBox.tooltip = tooltip layer.append(self.messageBox) self.layers.append(layer)
def __init__(self, director, player): Scene.__init__(self, director) self.player = player self.enemyGroup = EntityGroup([]) self.bulletGroup = EntityGroup([]) self.groups = [] self.groups.append(self.enemyGroup) self.groups.append(self.bulletGroup) self.bg = None self.collisionBg = None self.camera = Camera() self.HUD = HUD(self.director, (0, 467), True, player) hudLayer = Layer(self.director) hudLayer.append(self.HUD) self.layers.append(hudLayer) self.mouseHoveringHUD = False self.danger = False self.dangerLevel = 0 self.gameOver = False