~ubuntu-branches/ubuntu/utopic/frogatto-data/utopic

« back to all changes in this revision

Viewing changes to data/compiled/objects/wheel_big_wooden.cfg

  • Committer: Bazaar Package Importer
  • Author(s): Dmitry E. Oboukhov
  • Date: 2010-07-16 12:14:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100716121411-tobhfbyxrrz46dwz
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
[object_type]
 
2
id="wheel_big_wooden"
 
3
on_child_spawned="[
 
4
  if(child.type = 'wheel_big_wooden_shadow', set(child.zorder, parent.zorder-2)),
 
5
  if(child.type = 'rope_platform', set(vars.platforms, vars.platforms + [child])),
 
6
  if(child.type = 'vertical_rope',
 
7
                [set(child.zorder, parent.zorder-1), set(vars.ropes, vars.ropes + [child])])]"
 
8
on_draw="map(vars.ropes, 'rope', rope.set_pos_len(rotate * if(index, -1, 1), vars.rope_len))"
 
9
on_process="[
 
10
#we set the positions of all our platforms in here. Icky math ahead!#
 
11
map(vars.platforms, 'platform',
 
12
 
 
13
        #if the platform is going vertically up the left side#
 
14
    if(cycle_pos > 180 and cycle_pos < 180 + context.vars.rope_len/PLATFORM_SPEED,
 
15
           [set(platform.midpoint_x, context.midpoint_x - PLATFORM_X_DISTANCE),
 
16
            set(platform.midpoint_y, PLATFORM_Y_ADJUST + context.midpoint_y - (cycle_pos - 180)*PLATFORM_SPEED)],
 
17
                 
 
18
                #if the platform is going vertically down the right side#
 
19
                 if(cycle_pos > 360 + context.vars.rope_len/PLATFORM_SPEED,
 
20
                    [set(platform.midpoint_x, context.midpoint_x + PLATFORM_X_DISTANCE),
 
21
                         set(platform.midpoint_y, PLATFORM_Y_ADJUST + context.vars.other_wheel_position + (cycle_pos - (360 + context.vars.rope_len/PLATFORM_SPEED))*PLATFORM_SPEED)],
 
22
 
 
23
                        #if the platform is curving around the platform. This is basically
 
24
                         a circle once you subtract the time spent on the edges#
 
25
             [set(platform.midpoint_x, context.midpoint_x + (wave((if(cycle_pos <= 180, cycle_pos, cycle_pos - context.vars.rope_len/PLATFORM_SPEED)*1000)/360 + 250)*PLATFORM_X_DISTANCE)/1000),
 
26
              set(platform.midpoint_y, PLATFORM_Y_ADJUST + context.midpoint_y + (wave((if(cycle_pos <= 180, cycle_pos, cycle_pos - context.vars.rope_len/PLATFORM_SPEED)*1000)/360)*PLATFORM_X_DISTANCE)/1000 - if(cycle_pos > 180, context.vars.rope_len, 0))]
 
27
                ))
 
28
         
 
29
     #a variable representing where this platform is in its repeating cycle#
 
30
         where cycle_pos = (cycle + (index*context.vars.cycle_period)/size(vars.platforms))%context.vars.cycle_period
 
31
         
 
32
         ),
 
33
set(rotate, rotate + 1)]"
 
34
on_start_level="[
 
35
  set(vars.cycle_period, 360 + (abs(midpoint_y - vars.other_wheel_position)*2)/PLATFORM_SPEED),
 
36
  if(vars.other_wheel_position != null(),
 
37
    [set(activation_area, [x - 30, min(midpoint_y, vars.other_wheel_position) - img_w, img_w + 60, abs(midpoint_y - vars.other_wheel_position) + img_h*2]),
 
38
         spawn('wheel_big_wooden', midpoint_x, vars.other_wheel_position, facing),
 
39
         spawn('vertical_rope', x+10, min(midpoint_y, vars.other_wheel_position), facing),
 
40
         spawn('vertical_rope', x+img_w-10, min(midpoint_y, vars.other_wheel_position), facing),
 
41
         map([0] * vars.nplatforms, spawn('rope_platform', x, y, facing))
 
42
         ]),
 
43
  spawn('wheel_big_wooden_shadow',midpoint_x-10, midpoint_y-4,facing, [set('zorder', zorder-2)]),
 
44
  set(vars.rope_len, abs(midpoint_y - vars.other_wheel_position))
 
45
  ]"
 
46
zorder="-5"
 
47
        [consts]
 
48
        PLATFORM_SPEED="2"
 
49
        PLATFORM_X_DISTANCE="72"
 
50
        PLATFORM_Y_ADJUST="30"
 
51
        [/consts]
 
52
 
 
53
        [vars]
 
54
        cycle_period="0"
 
55
        nplatforms="0"
 
56
        other_wheel_position="null()"
 
57
        platforms="[]"
 
58
        rope_len="0"
 
59
        ropes="[]"
 
60
        [/vars]
 
61
 
 
62
        [properties]
 
63
        left_rope="vars.ropes[0]"
 
64
        right_rope="vars.ropes[1]"
 
65
        [/properties]
 
66
 
 
67
        [animation]
 
68
        frame_info="1,1,1,0,570,648,78,79"
 
69
        id="normal"
 
70
        image="compiled-0.png"
 
71
        rect="569,647,648,726"
 
72
        [/animation]
 
73
 
 
74
[/object_type]
 
75