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
|
[object_type]
id=difficulty-selector
zorder=20
is_human=true
always_active=true
[properties]
team="'player'"
position="min(points.size-1, max(0, tmp.place))"
[/properties]
#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, 0, ~Casual~],
[160,170, 3, ~Intense~],
[160,190, 10, ~Unfair~]]"
[/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[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_up = "[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))),
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
[/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)
|