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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
[object_type]
id="wheel_rolling"
on_child_spawned="[
if(child.type = 'rope_platform', set(vars.platforms, vars.platforms + [child])),
if(child.type = 'wheel_rolling_shadow', set(vars.shadow, [child]))
]"
on_create="[
map(
range(vars.nplatforms),
spawn('rope_platform',x,y,facing)
),
spawn('wheel_rolling_shadow',midpoint_x-10,midpoint_y-4,facing, [set('zorder', zorder-2)])
]"
on_process="[
if((cycle%inertia) = 0, set(vars.rotation_speed, vars.rotation_speed - if(vars.rotation_speed > 0, 1, if(vars.rotation_speed < 0, -1, 0)))),
map(
vars.platforms,
'platform',
if(level.player.standing_on = platform,
set(vars.rotation_speed, #vars.rotation_speed + #(platform.x - center_x)/vars.inertia)
)
),
set(rotate, rotate + vars.rotation_speed),
set(x, x + vars.rotation_speed * DISTANCE_PER_ANGLE),
if(x < vars.left_x, set(x, vars.left_x)),
if(x > vars.right_x, set(x, vars.right_x)),
map(vars.shadow, 'shadow', [
set(shadow.rotate, rotate),
set(shadow.x, x)
]),
map(vars.platforms, 'platform', [
set(platform.midpoint_x, context.midpoint_x + (wave((if(angle <= 180, angle, angle - vars.rotation_speed)*1000)/360 + 250)*PLATFORM_X_DISTANCE)/1000),
set(platform.midpoint_y, PLATFORM_Y_ADJUST + context.midpoint_y + (wave((if(angle <= 180, angle, angle - vars.rotation_speed)*1000)/360)*PLATFORM_X_DISTANCE)/1000)
] where angle = (rotate + (index*360/vars.nplatforms))%360
)
]"
zorder="-5"
[consts]
CENTER_OFFSET="40"
DISTANCE_PER_ANGLE="1"
PLATFORM_X_DISTANCE="72"
PLATFORM_Y_ADJUST="30"
[/consts]
[vars]
platforms="[]"
rotation_speed="0"
shadow="[]"
[/vars]
[properties]
center_x="x+CENTER_OFFSET"
[/properties]
[animation]
frame_info="1,1,1,0,570,648,78,79"
id="normal"
image="compiled-0.png"
rect="569,647,648,726"
[/animation]
[/object_type]
|