1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
[object_type]
always_active="yes"
id="large_pipe_controller"
next_animation="'normal'"
on_create="if(level_points, [set(alpha, 0),
map(range(0,resolution), 'point', [
set(rope_ctrl.vars.index, point),
set(rope_ctrl.vars.x_1, rope_ctrl.midpoint_x),
set(rope_ctrl.vars.y_1, rope_ctrl.midpoint_y),
set(rope_ctrl.vars.x_2, bcurve(level_points, ind+100.0/resolution+1)[0]),
set(rope_ctrl.vars.y_2, bcurve(level_points, ind+100.0/resolution+1)[1]),
add_object(rope_ctrl),
] where rope_ctrl = object('pipe_angled_controller', bcurve(level_points, ind)[0], bcurve(level_points, ind)[1], 0) where ind = point * (100.0/resolution) ) where resolution = vars.resolution]
)"
on_end_anim="animation('normal')"
zorder="100"
[editor_info]
category="controllers"
help="Assign the pipe controller a label. Assign another object a label_of_this_object space sequencial_number."
[var]
name="resolution"
type="int"
value="10"
[/var]
[/editor_info]
[properties]
bcurve="def(points, percent)
if(size(points)=2,
[(points[0][0]*(100-percent) + points[1][0]*percent)/100.0,
(points[0][1]*(100-percent) + points[1][1]*percent)/100.0],
bcurve(map(range(size(points)-1), 'ind', bcurve(points[ind:ind+2], percent)), percent) #bcurve() this line's output when correct#
)"
level_points="map(sort(filter(level.chars, linked_object=sl) where sl=self.label, a.number < b.number), 'point', [point.midpoint_x, point.midpoint_y])"
[/properties]
[animation]
collide="0,0,28,28"
duration="1000"
frame_info="2,2,2,1,588,501,24,25"
frames="1"
id="normal"
image="compiled-2.png"
rect="586,499,613,526"
[/animation]
[/object_type]
|