/
platform.cfg
54 lines (53 loc) · 1.22 KB
/
platform.cfg
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
{
id: "platform",
hitpoints: 1,
surface_friction: 100,
platform_area: [0,0,48,1],
zorder: -1,
vars: {
move_speed: 3,
move_x1: 0,
move_x2: 0,
move_y1: 0,
move_y2: 0,
},
on_start_level: "set(activation_area, [vars.move_x1 - 100, vars.move_y1 - 100, (vars.move_x2 - vars.move_x1) + 200, (vars.move_y2 - vars.move_y1) + 200])",
on_process: "[
[[set(midpoint_x, vars.move_x1 + (img_w/2) * x_polarity + ((1000 + wave(cycle*vars.move_speed))*xdistance)/2000)] where xdistance = (vars.move_x2 - vars.move_x1) - img_w * x_polarity]
where x_polarity = if(vars.move_x2 > vars.move_x1, 1, -1)
,
[[set(midpoint_y, vars.move_y1 + (img_h/2) * y_polarity + ((1000 + wave(cycle*vars.move_speed))*ydistance)/2000)] where ydistance = (vars.move_y2 - vars.move_y1) - img_h * y_polarity]
where y_polarity = if(vars.move_y2 > vars.move_y1, 1, -1)
]",
editor_info: {
category: "platforms",
var: [
{
name: "move_speed",
type: "decimal",
min_value: 0.0,
max_value: 50.0
},
{
name: "move_x1",
type: "x",
value: "x",
},
{
name: "move_x2",
type: "x",
value: "x + img_w",
},
{
name: "move_y1",
type: "y",
value: "y",
},
{
name: "move_y2",
type: "y",
value: "y + img_h",
},
],
},
}