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)
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
def getCoord(self): angle1 = utilitary.coord(self.elem.center.coord["x"] + self.size, self.elem.center.coord["y"]) angle2 = utilitary.coord(self.elem.center.coord["x"] - self.size, self.elem.center.coord["y"]) sommet = utilitary.coord( self.elem.center.coord["x"], int(self.elem.center.coord["y"] - 3 / 2 * self.size)) return [angle1, angle2, sommet]
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
def getCoord(self): return [ util.coord(self.elem.center.coord["x"] + 0.5 * self.size, self.elem.center.coord["y"] + 1.6 * self.size), util.coord(self.elem.center.coord["x"] - 0.5 * self.size, self.elem.center.coord["y"] + 1.6 * self.size), util.coord(self.elem.center.coord["x"] + 0.5 * self.size, self.elem.center.coord["y"] - 2.3 * self.size), util.coord(self.elem.center.coord["x"] - 0.5 * self.size, self.elem.center.coord["y"] - 2.3 * self.size) ]
def __init__(self, GV, points_list, coord, speed=coord(0, 0), accel=coord(0, 0), tempo=1, collide=True): self.center = physical_point(coord, speed, accel, tempo) self.points_list = points_list self.collide = collide GV.elem_list.append(self)
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)
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)
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)
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
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