예제 #1
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherlixeira01")
         element_sprite2 = load_sprite_mainsheet("otherpets01")
         element_sprite3 = load_sprite_mainsheet("otherbarril01")
         element_sprite4 = load_sprite_mainsheet("othervaso01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (432,80))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (912,80))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (976,80))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1040,80))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1392,496))
         element6 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1392,560))
         
         element7 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (872 + randint(-200, 200),512 + randint(-200, 200)))
         element8 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1028 + randint(-200, 200),522 + randint(-200, 200)))
         
         element8.drop = [generateItem("item01"),generateItem("item02")]
         element7.drop = [generateItem("item02")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
         self.stage.add_element(element6)
         self.stage.add_element(element7)
         self.stage.add_element(element8)
예제 #2
0
    def render_to_dock(self, surface, mouse_pos):
        posx = 1
        posy = 1
        s_width = surface.get_width()
        s_height = surface.get_height()
        empty_slot = load_sprite_mainsheet("otherslot02")
        slot1 = 0
        icon_potion = load_sprite_mainsheet("icon02")
        slot2 = 0
        icon_batery = load_sprite_mainsheet("icon03")
        slot3 = 0
        for i in self.bag.itervalues():
            if i.name == u"Poção de Cura":
                slot1 += 1
            elif i.name == "Bateria":
                slot2 += 1

        #if slot1 > 0:
        #   slot_surface = empty_slot[0][0].copy()

        #surface.blit(icon_potion[0][0], (s_width/16,  (s_height/6) ) )
        surface.blit(self.smallText.render(str(slot1), True, (220, 220, 220)),
                     ((s_width / 24) * 23, (s_height / 8) * 2))
        surface.blit(self.smallText.render(str(slot2), True, (220, 220, 220)),
                     ((s_width / 24) * 23, (s_height / 8) * 6))

        return surface
예제 #3
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherbalde01")
         element_sprite2 = load_sprite_mainsheet("otherbalde02")
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         element_sprite3 = load_sprite_mainsheet("othervaso01")
         
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (680,190))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (630,170))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (496,144))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (400,200))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (680,300))
         element6 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (720,144))
         
         element.drop = [generateItem("item02")]
         element2.drop = [generateItem("item01")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
         self.stage.add_element(element6)
예제 #4
0
    def show_hotkeys(self, surface):
        empty_slot = load_sprite_mainsheet("other01")
        icon_01 = load_sprite_mainsheet("icon04")[0][0]
        icon_02 = load_sprite_mainsheet("icon05")[0][0]
        icon_03 = load_sprite_mainsheet("icon06")[0][0]
        icon_04 = load_sprite_mainsheet("icon07")[0][0]
        
        icons = [icon_01, icon_02, icon_03, icon_04]
        
        
        discrip_01, discrip_01_rect = text_objects(u"'Q' - Ataque Básico!", self.smallText)
        discrip_02, discrip_02_rect = text_objects(u"'W' - Ataque Elétrico.", self.smallText)
        discrip_03, discrip_03_rect = text_objects(u"'E' - Interação", self.smallText)
        discrip_04, discrip_04_rect = text_objects(u"'R' - Upgrade Especial", self.smallText)
        discription = [(discrip_01, discrip_01_rect),(discrip_02, discrip_02_rect),(discrip_03, discrip_03_rect),(discrip_04, discrip_04_rect)]
        
        
        
        actions = []
#         atq_1 = empty_slot.copy()
#         atq_1_rect = atq_1.get_rect()
#         
#         atq_2 = empty_slot.copy()
#         atq_2_rect = atq_2.get_rect()
#         
#         inter = empty_slot.copy()
#         inter_rect = inter.get_rect()
#         
#         item  = empty_slot.copy() 
#         item_rect = item.get_rect()
#         
        
        pos = 1
        for i in range(4):
            
            surf = empty_slot[0][0].copy()
            surf_rect = surf.get_rect()
            surf_rect.center = (surface.get_width()/6, surface.get_height()/5 * pos)
            icon_rect = icons[i].get_rect()
            icon_rect.center = (surf.get_width()/2, surf.get_height()/2) 
            surf.blit(icons[i], icon_rect)
            actions.append((surf, surf_rect))
            
            discription[i][1].left = surf_rect.right + 10
            discription[i][1].centery = surf_rect.centery
            surface.blit(discription[i][0],discription[i][1])
            
            
            pos += 1
            surface.blit(surf, surf_rect)
        
        
        caption, caption_rect = text_objects("Comandos:", self.largeText)
        caption_rect.centerx = surface.get_width()/2
        caption_rect.top = 10
        surface.blit(caption, caption_rect)
예제 #5
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("othervaso01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (528,272))
         self.stage.add_element(element)
예제 #6
0
 def reward(self):
     reward = [generateItem("item01"),generateItem("item01"),generateItem("item02"),generateItem("item02")]
     #drops = []
     drop_sprite = load_sprite_mainsheet("icon01")
     for item_rw in reward:
         self.stage.add_element(ElementBuilder(type = "DropedBag", stage = self.stage, sprite = drop_sprite, position = (640 + randint(-64, 64), 450 + randint(-64, 64)), item = item_rw))
     self.stage.playback()
예제 #7
0
    def generateEnemy(self,
                      stage,
                      entity_spot,
                      entity_id="enemymutuca01",
                      weapon_id="weapon02",
                      second_weapon_id="weapon06"):
        cfgentity = getEnemy(entity_id)
        sprite = load_sprite_mainsheet(cfgentity.sprite)
        rect = pygame.Rect(0, 0, int(cfgentity.dimensionx),
                           int(cfgentity.dimensiony))
        entity = gameEntities.gameEntity.Enemy(stage, sprite, rect, cfgentity,
                                               entity_spot)
        weapon = self.generateWeapon(weapon_id)
        entity.equip_set.add(weapon)

        if constants.GAMELEVEL == "HARD":
            entity.max_life = float(entity.max_life * 1.2)
            entity.life_base = float(entity.life_base * 1.2)
            entity.life = float(entity.life * 1.2)

            entity.max_mana = float(entity.max_mana * 2)
            entity.mana_base = float(entity.mana_base * 2)
            entity.mana = float(entity.mana * 2)

        if cfgentity.type == "boss":
            #             print "preparing boss"
            special_item = self.generateWeapon(second_weapon_id)
            entity.equip_set.special_item = special_item
            entity.brain.set_state("boss_exploring")
#             print "adding a boss"

        else:
            entity.brain.set_state("exploring")
        return entity
예제 #8
0
 def pre_reward(self):
     reward = [generateItem("item01"),generateItem("item01"),generateItem("item01"),generateItem("item02"),generateItem("item02"),generateItem("item02"),
               generateItem("item01"),generateItem("item01"),generateItem("item02")
               ]
     
     drop_sprite = load_sprite_mainsheet("icon01")
     for item_rw in reward:
         self.stage.add_element(ElementBuilder(type = "DropedBag", stage = self.stage, sprite = drop_sprite, position = (1432 + randint(-32, 32), 1100 + randint(-32, 32)), item = item_rw))
예제 #9
0
 def touch(self):
     self.touched = True
     drop_sprite = load_sprite_mainsheet("icon01")
     if self.drop != None:
         for item in self.drop:
             self.stage.add_element( DropedBag(self.stage, drop_sprite, (self.rect.centerx + randint(-32, 32), self.rect.centery + randint(-32, 32)), item))
     self.alive = False
     self.stage.focos_taken += 1
예제 #10
0
 def clean_the_map(self):
     #print "MAPA LIMPO - PORTAL ADICIONADO"
     for element_id in self.stage.config.portals:
         cfgportal = getPortal(element_id)
         sprite = load_sprite_mainsheet(cfgportal.sprite)
         element = ElementBuilder(type = "Portal", stage = self.stage, sprite = sprite, config = cfgportal)
         self.stage.add_element(element)
         self.clear = True
예제 #11
0
 def respaw(self):
     for entity in self.enemies:
         cfgentity = getEnemy(entity[0])
         sprite = load_sprite_mainsheet(cfgentity.sprite)
         rect = pygame.Rect(0, 0, int( cfgentity.dimensionx), int(cfgentity.dimensiony) )
         entity = Enemy(self.stage, sprite, rect, cfgentity, (entity[1],entity[2]))
         entity.equip_set.add(self.weapon)
         entity.brain.set_state("exploring")
         self.stage.add_entity(entity)
예제 #12
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherbalde01")
         element_sprite4 = load_sprite_mainsheet("otherprato01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (700,380))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (368,570))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (368,600))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (660,624))
         
         element.drop = [generateItem("item02")]
         element2.drop = [generateItem("item01")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
예제 #13
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherpets01")
         element_sprite2 = load_sprite_mainsheet("otherlixeira01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1168,816))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1424,816))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1200 + randint(-100, 100),700 + randint(-100, 100)))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1400 + randint(-100, 100),700 + randint(-100, 100)))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1488,120))
         
         element.drop = [generateItem("item01")]
         element2.drop = [generateItem("item02")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
예제 #14
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherbalde01")
         element_sprite3 = load_sprite_mainsheet("otherprato01")
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         
         focos = []
         
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1500,350)))
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1530 + randint(-100, 100),650 + randint(-100, 100))))
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (1230,770)))
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1030 + randint(-100, 100),470 + randint(-100, 100))))
         
         focos[0].drop  = [generateItem("item01"),generateItem("item02")]
         for f in focos:
             self.stage.add_element(f)
         
         self.stage.focos_total = len(focos)
예제 #15
0
    def start(self):
        if self.clear:
            self.clean_the_map()
        else:
            element_sprite = load_sprite_mainsheet("otherpets01")
            element_sprite2 = load_sprite_mainsheet("othervaso01")
            element_sprite3 = load_sprite_mainsheet("otherbarril01")
            element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (368,112))
            element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (464,112))
            element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (496,112))
            element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (528,112))
            element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (560,112))
            element6 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (784,112))
            element7 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (160,192))
            element8 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (170,210))
            element9 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (150,230))
            element10 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (162,250))
            element11 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (168,260))
            element10 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (200,275))
            element11 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (220,290))
            
            
            element.drop = [generateItem("item02")]

            
            element_sprite5 = load_sprite_mainsheet("otherspecial01")
            element20 = ElementBuilder(type = "SpecialItem", stage = self.stage, sprite = element_sprite5, position = (780,580))
            element20.drop = generateWeapon("weapon04")
            
            self.stage.add_element(element)
            self.stage.add_element(element2)
            self.stage.add_element(element3)
            self.stage.add_element(element4)
            self.stage.add_element(element5)
            self.stage.add_element(element6)
            self.stage.add_element(element7)
            self.stage.add_element(element8)
            self.stage.add_element(element9)
            self.stage.add_element(element10)
            self.stage.add_element(element11)
            self.stage.add_element(element20)
예제 #16
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite2 = load_sprite_mainsheet("otherbalde02")
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         element_sprite3 = load_sprite_mainsheet("othervaso02")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1600,755))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1200 + randint(-100, 100),200 + randint(-100, 100)))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1350 + randint(-100, 100),225 + randint(-100, 100)))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1400 + randint(-100, 100),200 + randint(-100, 100)))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (848,752))
         
         element2.drop = [generateItem("item02")]
         element3.drop = [generateItem("item01")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
예제 #17
0
 def touch(self):
     self.touched = True
     if self.drop != None:
         player = self.stage.get_close_entity(self.rect.center, "player", 64)
         if player:
             player.equip_set.special_item = self.drop
             player.to_talk(15, [u'Encontrei um Upgrade Especial!!', u'Pressione R para usar!'])
     self.alive = False
     
     sprite = load_sprite_mainsheet("effexplosion02")
     explosion = ElementBuilder(type = "Explosion", stage = self.stage, sprite = sprite, position = self.rect.center)
     self.stage.add_element(explosion)
예제 #18
0
 def __init__(self, entity):
     self.entity = entity
     self.bag = {}
     self.item_id = 0
     self.max_size = 12
     self.sprite = load_sprite_mainsheet("icon01")
     self.updated_inventory = None
     self.update()
     self.selected = None
     self.largeText = pygame.font.Font("multimedia/fonts/comic.ttf", 20)
     self.smallText = pygame.font.Font("multimedia/fonts/comic.ttf", 15)
     self.smallText.set_bold(True)
예제 #19
0
 def __init__(self, stage, delay= 30):
     StageScript.__init__(self, stage)
     self.smallText = pygame.font.Font("multimedia/fonts/comic.ttf", 12)
     self.text_bg = pygame.image.load("multimedia/windows/message_bg.png").convert_alpha()
     self.respaw_delay = delay
     self.last_respaw = delay
     self.enemies = []
     self.message = [u"Cuide bem da sua praça!",
                     u"E mantenha a cidade livre", u" do mosquito da dengue e zika!"]
     cfgweapon = getEquip("weapon01")
     sprite = load_sprite_mainsheet(cfgweapon.sprite)
     self.weapon = NoWeapon(cfgweapon, sprite)
예제 #20
0
    def start(self):
        if self.clear:
            self.clean_the_map()
            
        else:
            self.stage.playback(self.stage_song)
            self.pre_reward()
            self.stage.vision = 320
            
            element_sprite = load_sprite_mainsheet("otherpets01")
            element_sprite2 = load_sprite_mainsheet("otherpneu01")
            element_sprite3 = load_sprite_mainsheet("otherpneu02")
            element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (650,325))
            element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (620,390))
            element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1100,420))
            element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1000,380))
            element9 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1180,460))
            element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (480,230))
            
            element6 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite3, position = (1248,160))
            element7 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite3, position = (1376,160))
            element8 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite3, position = (1376,288))
            
            
#             element.drop = [generateItem("item01"),generateItem("item02")]
            element5.drop = [generateItem("item01"),generateItem("item02")]
#            element7.drop = [generateItem("item01"),generateItem("item02")]
            element9.drop = [generateItem("item01"),generateItem("item02")]
            
            self.stage.add_element(element)
            self.stage.add_element(element2)
            self.stage.add_element(element3)
            self.stage.add_element(element4)
            self.stage.add_element(element5)
            self.stage.add_element(element6)
            self.stage.add_element(element7)
            self.stage.add_element(element8)
            self.stage.add_element(element9)
예제 #21
0
 def generatePlayer(self,
                    stage,
                    entity_id="ent01",
                    weapon_id="weapon01",
                    second_weapon_id="weapon03"):
     cfgentity = getPlayer(entity_id)
     sprite = load_sprite_mainsheet(cfgentity.sprite)
     rect = pygame.Rect(0, 0, int(cfgentity.dimensionx),
                        int(cfgentity.dimensiony))
     entity = gameEntities.gameEntity.Player(stage, sprite, rect, cfgentity)
     weapon = self.generateWeapon(weapon_id)
     entity.equip_set.add(weapon)
     second_weapon = self.generateWeapon(second_weapon_id)
     entity.equip_set.add(second_weapon)
     return entity
예제 #22
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         self.stage.playback(self.stage_song)
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         element_sprite5 = load_sprite_mainsheet("othercaixadagua01")
         element_sprite6 = load_sprite_mainsheet("otherbarril01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite6, position = (496,720))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite6, position = (528,720))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite6, position = (560,720))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (512,576))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (584,576))
         element6 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite5, position = (670,700))
         
         
         element.drop = [generateItem("item01"),generateItem("item02")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
         self.stage.add_element(element6)
예제 #23
0
 def generateNPC(self,
                 stage,
                 entity_spot,
                 entity_id="npc01",
                 weapon_id="weapon01"):
     cfgentity = getNPC(entity_id)
     sprite = load_sprite_mainsheet(cfgentity.sprite)
     rect = pygame.Rect(0, 0, int(cfgentity.dimensionx),
                        int(cfgentity.dimensiony))
     entity = gameEntities.gameEntity.NPC(stage, sprite, rect, cfgentity,
                                          entity_spot)
     weapon = self.generateWeapon(weapon_id)
     entity.equip_set.add(weapon)
     entity.brain.set_state("roaming")
     return entity
예제 #24
0
    def generateEquip(self, equip_id="helmet01"):
        cfgequip = getEquip(equip_id)
        sprite = load_sprite_mainsheet(cfgequip.sprite)

        equip = None
        if equip_id.count("helmet"):
            equip = Helmet(cfgequip, sprite)
        if equip_id.count("chest"):
            equip = Chest(cfgequip, sprite)
        if equip_id.count("boots"):
            equip = Boots(cfgequip, sprite)
        if equip_id.count("bottom"):
            equip = Bottom(cfgequip, sprite)

        #equip = Helmet(cfgequip, sprite)
        return equip
예제 #25
0
    def update(self):
        empty_slot = load_sprite_mainsheet("other01")
        inventory = []

        for i in self.bag.itervalues():
            slot_surface = empty_slot[0][0].copy()
            #slot_rect = slot.get_rect()
            icon_rect = i.icon.get_rect()
            icon_rect.center = (slot_surface.get_width() / 2,
                                slot_surface.get_height() / 2)
            slot_surface.blit(i.icon, icon_rect)
            inventory.append((slot_surface, i.id, slot_surface.get_rect()))

        for s in range(self.max_size):
            if len(inventory) < self.max_size:
                slot_surface = empty_slot[0][0].copy()
                inventory.append((slot_surface, None, slot_surface.get_rect()))

        self.updated_inventory = inventory
예제 #26
0
 def generateWeapon(self, equip_id="weapon01"):
     cfgweapon = getEquip(equip_id)
     sprite = load_sprite_mainsheet(cfgweapon.sprite)
     weapon = SimpleWeapon(cfgweapon, sprite)
     return weapon
예제 #27
0
 def generateItem(self, item_id="item01"):
     cfgitem = getItem(item_id)
     sprite = load_sprite_mainsheet(cfgitem.sprite)
     item = Item(cfgitem, sprite)
     return item
예제 #28
0
 def generatePortal(self, stage, element_id):
     cfgportal = getPortal(element_id)
     sprite = load_sprite_mainsheet(cfgportal.sprite)
     element = gameStages.stageElements.Portal(stage, sprite, cfgportal)
     return element
예제 #29
0
 def __init__(self, entity, delay=1.):
     Action.__init__(self, delay)
     self.entity = entity
     self.sprite = load_sprite_mainsheet("effinteract01")