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

« back to all changes in this revision

Viewing changes to data/compiled/objects/wheel_rolling.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_rolling"
 
3
on_child_spawned="[
 
4
        if(child.type = 'rope_platform', set(vars.platforms, vars.platforms + [child])),
 
5
        if(child.type = 'wheel_rolling_shadow', set(vars.shadow, [child]))
 
6
]"
 
7
on_create="[
 
8
        map(
 
9
                range(vars.nplatforms),
 
10
                spawn('rope_platform',x,y,facing)
 
11
        ),
 
12
        spawn('wheel_rolling_shadow',midpoint_x-10,midpoint_y-4,facing, [set('zorder', zorder-2)])
 
13
]"
 
14
on_process="[
 
15
        if((cycle%inertia) = 0, set(vars.rotation_speed, vars.rotation_speed - if(vars.rotation_speed > 0, 1, if(vars.rotation_speed < 0, -1, 0)))),
 
16
        map(
 
17
                vars.platforms,
 
18
                'platform',
 
19
                if(level.player.standing_on = platform,
 
20
                        set(vars.rotation_speed, #vars.rotation_speed + #(platform.x - center_x)/vars.inertia)
 
21
                )
 
22
        ),
 
23
        set(rotate, rotate + vars.rotation_speed),
 
24
        set(x, x + vars.rotation_speed * DISTANCE_PER_ANGLE),
 
25
        if(x < vars.left_x, set(x, vars.left_x)),
 
26
        if(x > vars.right_x, set(x, vars.right_x)),
 
27
        map(vars.shadow, 'shadow', [
 
28
                set(shadow.rotate, rotate),
 
29
                set(shadow.x, x)
 
30
        ]),
 
31
        map(vars.platforms,     'platform', [
 
32
 
 
33
                set(platform.midpoint_x, context.midpoint_x + (wave((if(angle <= 180, angle, angle - vars.rotation_speed)*1000)/360 + 250)*PLATFORM_X_DISTANCE)/1000),
 
34
                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)
 
35
 
 
36
    ] where angle = (rotate + (index*360/vars.nplatforms))%360
 
37
        )
 
38
]"
 
39
zorder="-5"
 
40
        [consts]
 
41
        CENTER_OFFSET="40"
 
42
        DISTANCE_PER_ANGLE="1"
 
43
        PLATFORM_X_DISTANCE="72"
 
44
        PLATFORM_Y_ADJUST="30"
 
45
        [/consts]
 
46
 
 
47
        [vars]
 
48
        platforms="[]"
 
49
        rotation_speed="0"
 
50
        shadow="[]"
 
51
        [/vars]
 
52
 
 
53
        [properties]
 
54
        center_x="x+CENTER_OFFSET"
 
55
        [/properties]
 
56
 
 
57
        [animation]
 
58
        frame_info="1,1,1,0,570,648,78,79"
 
59
        id="normal"
 
60
        image="compiled-0.png"
 
61
        rect="569,647,648,726"
 
62
        [/animation]
 
63
 
 
64
[/object_type]
 
65