File: map-selector.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 (92 lines) | stat: -rw-r--r-- 3,376 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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
id: "map-selector",
zorder: 60,
is_human: true,
always_active: true,
properties: {
	team: "'player'",
	position: "min(points.size-1, max(0, tmp.place))",
	prior_position: "index(points,find(points, value[2] = came_from_level))"
},

#We multiply by two for position because frogatto scales up the graphics by two. We then subtract by 16 to center the 16-pixel image.#
vars: {
	#points are the locations in the main-map image of each location for frogatto to go.#
	points:[[ 160, 400, "frogatto-grotto.cfg", ~Frogatto Grotto~ ],
			[ 303, 334, "secluded-hut.cfg", ~Secluded Hut~ ],
			[ 416, 404, "crevice-village.cfg", ~Crevice Village~ ],
			[ 490, 350, "foreboding-forest.cfg", ~Foreboding Forest~ ],
			[ 410, 310, "bon-bosque.cfg", ~Bon Bosque~ ],
			[ 330, 245, "watery-alley.cfg", ~Watery Alley~ ],
			[ 380, 200, "milgrams-basement-junction.cfg", ~Milgram's Castle~ ],
			[ 360, 100, "milgrams-throne-room-entrance.cfg", ~Milgram's Throne Room~ ]],
},
on_start_level: "[ if(vars.player.vars.levels_visited,
				 		set(vars.points,filter(vars.points, 'p',
	                              p[2] in vars.player.vars.levels_visited))),
	            fire_event('do_setup')]",

#tmp.place is the index number for each location, in the points list.
#
on_do_setup: "[set(alpha,0),
			if(prior_position < points.size and prior_position >= 0, 
			set(tmp.place, prior_position),
			set(tmp.place, 0)),
		set(x, (points[position][0]*2-16)), set(y, (points[position][1]*2-16)),
		map(vars.points, 'p', spawn('text_controller', p[0]*2, p[1]*2 + 40, facing,
		                            [set_var('txt', p[3]),set_var('align', 'center')])),
		    
		    spawn(type+'.arrow',mid_x,mid_y,facing, set(child.parent,me))
		    ]",
on_ctrl_down: "fire_event('ctrl_left')",
on_ctrl_up: "fire_event('ctrl_right')",
on_ctrl_right: "[set(tmp.place,tmp.place+1), sound('MenuCursorMove.ogg')]",
on_ctrl_left: "[set(tmp.place,tmp.place-1), sound('MenuCursorMove.ogg')]",
on_ctrl_tongue: "[
		set(control_lock, []),
		screen_flash([255,255,255,0], [0,0,0,5], 50),
		schedule(50,
		  [set(vars.player.alpha, 0),
	      execute(vars.player, schedule(1, set(brightness, 255))),
		  add_object(vars.player), teleport(points[position][2],'','instant'),sound('MenuConfirm.ogg'),
		  screen_flash([255,255,255,255], [0,0,0,-5], 50),
		  set(control_lock, null)]
		  )
		]",
on_ctrl_jump: "fire_event('ctrl_tongue')",

"on_mouse_up*": "
	if(points[position] = chosen, 
		fire_event('ctrl_tongue'),
		[set(tmp.place, find_index(points, chosen)), sound('MenuCursorMove.ogg')]
		) where chosen = choose(points, -distance([mouse_x/2, mouse_y/2], value[0:2]))",

on_process: "[if(tmp.place < 0, set(tmp.place, 0)), if(tmp.place > points.size-1, set(tmp.place, points.size-1)), set(x, (x*4 + points[position][0]*2-16) / 5), set(y, (y*4 + points[position][1]*2-16) / 5)]",
hidden_in_game: true,
animation: {
	id: "normal",
	image: "characters/stand_in_selector.png",
	rect: [0,0,15,15],
},
object_type: [
	{
		id: "arrow",
		ignore_collide: true,
		zorder: 60,
		
		on_end_anim: "set(animation,animation)",
		on_process:  "[set(relative_y, -60 + 4*sin(cycle*10)),set(relative_x,-img_w/2),
						set(brightness, 355 + 255*sin(cycle*8))]",
		
		animation: {
			id: "normal",
			image: "gui/arrow-menu-cursor.png",
			rect: [0,0,23,23],
			frames: 8,
			frames_per_row: 4,
			duration: 3,
			scale: 3,
		},
	},],

}