Пример #1
0
 def __init__(self, x, y, angle, GV):
     self.elem = element(GV, [coord(x, y)],
                         coord(x, y),
                         speed=coord(10 * math.cos(angle),
                                     -10 * math.sin(angle)),
                         collide=False)
     GV.obj_list.append(self)
Пример #2
0
 def __init__(self, x1, y1, x2, y2, GV, color=(0, 0, 0)):
     self.draw_info = [x1, y1, x2 - x1, y2 - y1]
     self.elem = element(
         GV, [coord(x1, y1),
              coord(x2, y1),
              coord(x1, y2),
              coord(x2, y2)], coord(x1, y1))
     GV.obj_list.append(self)
     self.color = color
Пример #3
0
 def __init__(self, x, y, GV, text):
     self.elem = element(GV, [coord(x + GV.size / 2, y - GV.size)],
                         coord(x + GV.size / 2, y - GV.size),
                         collide=False)
     GV.obj_list.append(self)
     self.size = GV.size
     self.point_list = [(x + GV.size / 3, y - GV.size * 3 / 4),
                        (x + GV.size * 2 / 3, y - GV.size * 3 / 4),
                        (x + GV.size * 3 / 4, y - 2 * GV.size),
                        (x + GV.size / 4, y - 2 * GV.size)]
     self.text = text
Пример #4
0
 def __init__(self, x, y, GV):
     self.angle_cannon = 0
     self.size = GV.size / 2.5
     self.dead = False
     self.fire = 5
     self.elem = element(GV, [
         coord(x + self.size, y),
         coord(x + self.size, y - int(self.size * 3 / 2)),
         coord(x - self.size, y - int(self.size * 3 / 2)),
         coord(x - self.size, y)
     ], coord(x, y))
     GV.obj_list.append(self)
Пример #5
0
 def __init__(self, x, y, size, GV):
     h = size / 15
     self.color = color = (0, 200, 0)
     self.point_list = [[x + size - h, y], [x + size - h, y - size * 3 / 2],
                        [x, y - size * 7 / 4 + h / 2],
                        [x + size - h, y - size * 2 + h],
                        [x + size - h, y - size * 2],
                        [x + size, y - size * 2], [x + size, y]]
     self.elem = element(
         GV,
         [coord(x, y),
          coord(x + size, y),
          coord(x + size, y + 2 * size)], coord(x,
                                                y + 2 * size), coord(x, y))
     GV.obj_list.append(self)
Пример #6
0
    def __init__(self, x1, y, number, size, GV):
        self.point_list = []
        for i in range(0, number, 1):
            self.point_list.append([x1 + i * size, y])
            self.point_list.append([x1 + i * size + size / 2, y - size])
            self.color = (200, 0, 0)

        self.elem = element(GV, [
            coord(x1, y),
            coord(x1 + number * size, y),
            coord(x1 + number * size, y - size * 3 / 4),
            coord(x1, y - size * 3 / 4)
        ], coord(x1, y))

        self.point_list.append([x1 + number * size, y])
        GV.obj_list.append(self)
Пример #7
0
    def __init__(self, x, y, GV):
        self.angle_body = math.pi / 2
        self.angle_l_arm = -2 * math.pi / 3
        self.angle_r_arm = -math.pi / 3
        self.angle_l_leg = -2 * math.pi / 3
        self.angle_r_leg = -math.pi / 3
        self.angle_l_knee = -math.pi / 16 * 9
        self.angle_r_knee = -math.pi / 16 * 7
        self.size = GV.size / 2.5
        self.health = 9
        self.energy = 1
        self.elem = physics.element(GV,
                                    None,
                                    util.coord(x, y),
                                    accel=util.coord(0, 1))
        self.isAlive = True
        self.is_grounded = False
        self.on_wall = False
        GV.obj_list.append(self)

        self.running = False
        self.jumping = False
Пример #8
0
 def __init__(self, x, y, size, GV):
     self.elem = element(GV, [coord(x + size / 2, y - size)],
                         coord(x + size / 2, y - size),
                         collide=False)
     GV.obj_list.append(self)
     self.size = size