File: difficulty-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 (86 lines) | stat: -rw-r--r-- 2,533 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
{
id: "difficulty-selector",
zorder: 20,
is_human: true,
always_active: true,
prototype: ["standard_values"],
properties: {
	team: "'player'",
	position: "min(points.size-1, max(0, tmp.place))",
},

#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,
    150,
    #difficulty_casual#
    -1,
    ~Casual~
  ],
  [
    160,
    170,
    #difficulty_challenging#
    0,
    ~Intense~
  ],
//  [
//    160,
//    190,
//    #difficulty_unfair#
//    1,
//    ~Unfair~
//  ]
],
},
on_start_level: "[ if(vars.player.vars.levels_visited,
			 		set(vars.points,if(filtered_points.size > 0,
					                 filtered_points, vars.points)
					  where filtered_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: "[if(vars.you_are_here < points.size, 
			set(tmp.place, vars.you_are_here),
			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 +60, p[1]*2+8, facing,
		                            [set_var('txt', p[3])]))]",

#	on_ctrl_down="fire_event('ctrl_left')"
#	on_ctrl_up="fire_event('ctrl_right')"
on_ctrl_down: "[set(tmp.place,tmp.place+1), sound('MenuCursorMove.ogg')]",
on_ctrl_right: "fire_event('ctrl_down')",
on_ctrl_up: "[set(tmp.place,tmp.place-1), sound('MenuCursorMove.ogg')]",
on_ctrl_left: "fire_event('ctrl_up')",
on_ctrl_tongue: "if(cycle > 30, [
 		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))),
 	      execute(vars.player, set(difficulty, vars.points[tmp.place][2] )),
 		  add_object(vars.player), teleport('frogatto-grotto-frogattos-room.cfg','','iris'),sound('MenuConfirm.ogg'),
 		  set(control_lock, null)]
 		  )
 		])",
on_ctrl_jump: "fire_event('ctrl_tongue')",
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),]",
animation: {
	id: "normal",
	image: "characters/stand_in_selector.png",
	rect: [0,0,15,15],
},
}