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
|
[object_type]
functions="def stretch_rope(xa, ya, xb, yb) [
map(range(totLength/len), 'range',
spawn('rope_controller.rope', pa, pb, 0, set(rotate, angle(xa, ya, xb, yb)-90))
where pa = xa + ((xb - xa)*(point*100000/totLength))/100000
where pb = ya + ((yb - ya)*(point*100000/totLength))/100000
where point = range * len
) where totLength = length(xa, ya, xb, yb)
where len = 6
];"
id="rope_controller"
ignore_collide="true"
on_create="[
stretch_rope(x,y,vars.end_x,vars.end_y),
set(alpha, 30)
]"
[animation]
duration="1000"
frame_info="2,1,2,1,338,501,24,26"
frames="1"
id="normal"
image="compiled-2.png"
rect="336,500,363,527"
[/animation]
[object_type]
id="rope"
[animation]
duration="5000000"
frames="1"
id="normal"
image="props/rope-vertical.png"
pad="0"
rect="0,0,3,3"
[/animation]
[/object_type]
[/object_type]
|