def update(self, items_dict):
        self.tiles = []
        
        yn = 0
        
        n = 1

        for item, number in items_dict.items():
            point = Point(self.x, self.y - yn*self.dy)
            tilename = self.tilenames[item]
            
            width = self.surface.tiledict[tilename].width
            height = self.surface.tiledict[tilename].height

            shift = Point(width, height/2)

            sprite = create_tile(point  - shift, tilename)
            label = create_label("F-%s [%s]" % (n, number), point)
            
            self.tiles.append(label)
            self.tiles.append(sprite)

            self.slots[n] = item
            
            yn+=1
            n+=1
Beispiel #2
0
 def draw(self):
     position = self.position
     if self.moving:
         tilename = self.tilename + self.get_animation('moving')
     else:
         tilename = self.tilename
     return [create_tile(position, tilename)]
 def draw(self):
     position = self.position
     if self.moving:
         tilename = self.tilename + self.get_animation('moving')
     else:
         tilename = self.tilename
     return [create_tile(position, tilename)]
Beispiel #4
0
    def update(self, items_dict):
        self.tiles = []

        yn = 0

        n = 1

        for item, number in items_dict.items():
            point = Point(self.x, self.y - yn * self.dy)
            tilename = self.tilenames[item]

            width = self.surface.tiledict[tilename].width
            height = self.surface.tiledict[tilename].height

            shift = Point(width, height / 2)

            sprite = create_tile(point - shift, tilename)
            label = create_label("F-%s [%s]" % (n, number), point)

            self.tiles.append(label)
            self.tiles.append(sprite)

            self.slots[n] = item

            yn += 1
            n += 1
 def update(self, force=False):
     "обноление на каждом фрейме"
     #если положение не изменилось то ничего не делаем
     if not self.surface.prev_position==self.surface.position or force:
         looked = self.look_around()
         
         self.tiles = [create_tile(point+self.surface.center, tile) for point, tile in looked]
Beispiel #6
0
 def draw(self):
     position = self.position
     if self.dead:
         tilename = self.tilename + self.get_animation('death')
     else:
         tilename = self.tilename + self.get_animation('defend')
     
     sprite = create_tile(position, tilename, -1 )
     return [sprite]
Beispiel #7
0
    def update(self, force=False):
        "обноление на каждом фрейме"
        #если положение не изменилось то ничего не делаем
        if not self.surface.prev_position == self.surface.position or force:
            looked = self.look_around()

            self.tiles = [
                create_tile(point + self.surface.center, tile)
                for point, tile in looked
            ]
 def draw(self):
     return [create_tile( self.position, self.tilename)]
 def draw(self):
     
     return [create_tile(self.position, self.tilename, -1, hover=self.hovered)]
 def draw(self):
     tilename = '%s_%s' % (self.tilename, self.number)
     return [create_tile(self.position, tilename, -1)]
Beispiel #11
0
 def draw(self):
     tilename = '%s_%s' % (self.tilename, self.number)
     return [create_tile(self.position, tilename, -1)]
Beispiel #12
0
 def draw(self):
     return [create_tile(self.position, self.tilename, -1, self.hovered)]
Beispiel #13
0
 def draw(self):
     return [create_tile(self.position, self.tilename)]
Beispiel #14
0
 def draw(self):
     if not self.explosion:
         return Movable.draw(self)
     else:
         tilename = self.tilename + self.get_animation('explosion')
         return [create_tile(self.position, tilename, 1)]
Beispiel #15
0
 def draw(self):
     if self._rainbow:
         tilename = self.tilename + self.get_animation('rainbow')
         return [create_tile(self.position, tilename, 1)]
     else:
         return Movable.draw(self)
Beispiel #16
0
 def draw(self):
     tilename = self.tilename + self.get_animation('attack')
     return [create_tile(self.position, tilename)]