Exemple #1
0
 def __init__(self, x, y, w, h, objects = [], creatures = [],
              start  = False):
     self.inner_rect = Rect.from_dimensions(x + WALL_WIDTH, y + int(WALL_WIDTH * 1.25),
                                            w + WALL_WIDTH, h + int(WALL_WIDTH * 1.5))
     self.outer_rect = Rect.from_dimensions(x, y,
                                            2 * WALL_WIDTH + w,
                                            2 * WALL_WIDTH + h)
Exemple #2
0
 def __init__(self, horizontal, x, y, length):
     if horizontal:
         w = length
         h = self.thickness()
         self.outer_rect = Rect.from_dimensions(
             x + self.thickness() / 2,
             y - WALL_WIDTH,
             w - int(1.08 * self.thickness()),
             h + WALL_WIDTH)
     else:
         w = self.thickness()
         h = length
         self.outer_rect = Rect.from_dimensions(
             x - WALL_WIDTH,
             y + self.thickness() / 2,
             w + WALL_WIDTH,
             h - int(1.45 * self.thickness()))
     self.inner_rect = Rect.from_dimensions(x, y, w, h)
Exemple #3
0
 def __init__(self, go_through, symbol, description,
              event_map = {}, range = 1, id = None, x_ = 0,
              y_ = 0, color = TEXT_COLOR, delayed = empty_interaction):
     delayed(self)
     self.set_events(self.event_map)
     self.rect_ = Rect.from_dimensions(0, 0, 0, 0)
Exemple #4
0
 def __init__(self, origin, x, y, w, h):
     self.strength = origin.strength
     self.remove = False
     self.sprite = vertex_list_from_rect(x, y, w, h)
     self.rect = Rect.from_dimensions(x, y, w, h)
Exemple #5
0
 def __init__(self, x, y, w, h):
     rect = Rect.from_dimensions(x, y, w, h)
     def fun(objects):
         return rect.overlaps(objects[0].rect)
     super(HeroEnterRegion, self).__init__([HERO_ID], fun)