File: map-selector.cfg

package info (click to toggle)
frogatto-data 1.0-2
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze
  • size: 155,116 kB
  • sloc: makefile: 1
file content (62 lines) | stat: -rw-r--r-- 2,816 bytes parent folder | download
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
[object_type]
	id=map-selector
	zorder=20
	is_human=true
	always_active=true

	
	#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]
		team="'player'"
		#points are the locations in the main-map image of each location for frogatto to go.#
		points="[[108,345, 'frogatto-grotto.cfg', 'Frogatto Grotto'],
		         [183,331, 'secluded-hut.cfg', 'Secluded Hut'],
				 [294,395, 'crevice-village.cfg', 'Crevice Village'],
				 [358,343, 'foreboding-forest.cfg', 'Foreboding Forest'],
				 [324,290, 'bon-bosque.cfg', 'Bon Bosque'],
				 [272,219, 'milgrams-throne-room-entrance.cfg', ~Milgram's Castle~]]"
	[/vars]
	
	on_create="[ 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="[if(vars.you_are_here < points.size, 
			set(tmp.place, vars.you_are_here),
			set(tmp.place, 0)),
		set(x, (points[tmp.place][0]*2-16)), set(y, (points[tmp.place][1]*2-16)),
		map(vars.points, 'p', spawn('text_controller', p[0]*2, p[1]*2 + 40, facing,
		                            [set_var('txt', p[3])]))]"
	
	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[tmp.place][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_process= "[if(tmp.place < 0, set(tmp.place, 0)), if(tmp.place > points.size-1, set(tmp.place, points.size-1)), if(tmp.place < 0, 0, if(tmp.place > points.size-1, 0, [set(x, (x*4 + points[tmp.place][0]*2-16) / 5), set(y, (y*4 + points[tmp.place][1]*2-16) / 5)]))]"
	
	[animation]
		id=normal
		image=characters/stand_in_selector.png
		rect=0,0,15,15
	[/animation]
[/object_type]

#<Sirp>	DDR: so, when you enter the map level, save the player object in a variable.
#<Sirp>	like set(vars.player_backup, level.player)
#<Sirp>	then add the cursor object, which is playable. Since the cursor object is playable it will automatically remove the old player from the level.
#<Sirp>	then, when it's time to exit the map into a new level, before doing so, add the player back into the level. .... add_object(vars.player_backup)