Scripts are included in the zip file, but here they are again
Code: Select all
define constant(18, second)
global variable(1, my choice)
plotscript, my event with a choice, begin
my choice := choose a thing
show text box(1)
wait for text box
end
plotscript, choose a thing, begin
variable(col)
col := setup choose a thing
variable(holder, cursor)
holder := lookup slice(sli:choice holder, col)
cursor := lookup slice(sli:cursor, col)
variable(sl, need update)
sl := first child(holder)
variable(result)
result := -1
need update := true
while(true) do(
# Input
if(keypress(cancel key)) then(
result := -1
break
)
if(keypress(use key)) then(
result := slice child index(sl)
break
)
if(keypress(right key)) then(
sl := next sibling(sl)
if(sl == none) then(sl := first child(holder))
need update := true
)elseif(keypress(left key)) then(
sl := previous sibling(sl)
if(sl == none) then(sl := last child(holder))
need update := true
)
# Update
if(need update) then(
set slice width(cursor, slice width(sl))
set slice height(cursor, slice height(sl))
move slice to screen pos(cursor, slice screen x(sl), slice screen y(sl), second / 3)
play sound(sfx:select8bit)
need update := false
)
wait(1)
)
cleanup choose a thing(col)
exit(result)
end
script, setup choose a thing, begin
suspend player
exit(load slice collection(0))
end
script, cleanup choose a thing, col, begin
free slice(col)
wait(second / 4)
resume player
end