示例#1
0
 def __init__(self, width, height):
     Panel.__init__(self, (0, 0), (800, 30))
     self.rect.midtop = (width / 2 , 0)
     self.background_color = pygame.Color("#00000000")
     self.border_color = pygame.Color("#00000000")
     self.text = ""
     
     event_system.on(self.on_show_notification, USEREVENT, 'show_notification')
     event_system.on(self.on_hide_notification, USEREVENT, 'hide_notification')
示例#2
0
    def __init__(self, map):
        self.map = map
        self.target = None
        self.actions = 1

        event_system.on(self.on_action_card, USEREVENT, "action_card")
        event_system.on(self.on_select_target, USEREVENT, "select_target")
        event_system.on(self.on_end_turn, USEREVENT, "end_turn")
        event_system.on(self.on_move_player, USEREVENT, "move_player")
示例#3
0
    def __init__(self, map):
        self.map = map
        self.target = None
        self.actions = 1

        event_system.on(self.on_action_card, USEREVENT, 'action_card')
        event_system.on(self.on_select_target, USEREVENT, 'select_target')
        event_system.on(self.on_end_turn, USEREVENT, 'end_turn')
        event_system.on(self.on_move_player, USEREVENT, 'move_player')
示例#4
0
    def __init__(self, width, height, level_map):
        Sprite.__init__(self)

        self.map_sprites = SpriteSheet("sprites_map.png", rows=16, columns=16, starty=40)
        self.unit_sprites = SpriteSheet("sprites_char.png", rows=41, columns=15, startx=7, 
                                        starty=120, width=26, height=26, skipx=9, 
                                        skipy=8)

        self.fow_sprite = pygame.Surface((16, 16)).convert()
        self.fow_sprite.fill(MapSprite.BLACK)
        self.fow_sprite.set_alpha(128)

        self.camera = Camera(width, height)
        self.map = level_map

        self.image = pygame.Surface((width, height)).convert()
        self.rect = pygame.Rect((0, 0), (width, height))
        self.on_map_changed(None)
        
        event_system.on(self.on_map_changed, USEREVENT, 'map_changed')
        event_system.on(self.on_mouse_up, MOUSEBUTTONUP)
        event_system.on(self.on_keyup, KEYUP)