File: falling_platform.cfg

package info (click to toggle)
frogatto-data 1.3.1%2Bdfsg-4
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 254,428 kB
  • sloc: xml: 584; python: 396; perl: 249; sh: 126; ruby: 69; makefile: 21
file content (37 lines) | stat: -rw-r--r-- 1,142 bytes parent folder | download | duplicates (3)
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
{
id: "falling_platform",
always_active: true,
platform_area: [0,0,188,1],
properties: {
	standing_midpoint: "midpoint_x + (rotated_rect[0] + rotated_rect[2])/4",
	tilt_accel: "if(level.player.standing_on != me, 0,
	               ((level.player.midpoint_x - standing_midpoint)/10)*0.0001)",
	base_rect: "[-img_w, -img_h, img_w, -img_h, img_w, img_h, -img_w, img_h]",
	rotated_rect: "rotate_rect(0, 3000, vars.tilt, base_rect)",
	offset_rect: "map(range(8), 'n', (r1[n] - r2[n])/2) where r1 = rotated_rect, r2 = base_rect",
},
vars: {
	tilt: 0,
	tilt_velocity: 0,
},
on_process: "[
	   if(abs(vars.tilt) > 90, die()),
	   add(y, abs(vars.tilt_velocity*5)),
	   set(vars.tilt_velocity, vars.tilt_velocity*1.02 + tilt_accel),
	   add(vars.tilt, vars.tilt_velocity),
	   set(platform_area, [r[0]/2, r[1]/2+16, img_w/2 + r[2]/2]),
	   set(platform_offsets, [0, (rotated_rect[3] - rotated_rect[1])/2]),
	       set(custom_draw, [0, 1, 2, 3, r])] where r = offset_rect",
editor_info: {
	category: "platforms",
},
animation: {
	id: "normal",
	no_remove_alpha_borders: true,
	image: "props/falling-platform.png",
	x: 0,
	y: 0,
	w: 208,
	h: 160,
},
}