an atelier fangame for the pico-8
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
atelier_phoebe/screen_workbench.lua

54 lines
1.6 KiB

page_flip = 0
timer = 0
function bench_update()
if btnp(0) then
animate(letters_move_to(-10-80, 8+8, -10, 8))
change_screen(screen_letters)
end
if btnp(1) then
animate(recipe_list_move_to(30+80, 8+8, 30, 8))
change_screen(screen_recipe_list)
end
if btnp(2) then
animate(inventory_slide(0, inventory_drawer_height_max))
change_screen(screen_inventory)
end
if btnp(5) then
sfx(4)
change_screen(screen_walkaround)
end
end
function bench_draw()
cls()
draw_background()
current_recipe = grimoire[page_idx]
outwards_x = 80
outwards_y = outwards_x/10
draw_paper(30+outwards_x, 8+outwards_y, 128, 128)
draw_recipe_on_paper(current_recipe, 30+outwards_x, 8+outwards_y)
decorate_recipe_unfinished(current_recipe, 30+outwards_x, 8+outwards_y)
draw_paper(letters_offset_x, letters_offset_y, 128, 128)
draw_letter_on_paper(letters[letter_idx], letters_offset_x+14, letters_offset_y+4)
draw_drawer()
end
screen_workbench = {draw=bench_draw, update=bench_update}
screen_workbench = screen_conversation({
{phoebe_portrait, "this is my workbench."},
{phoebe_portrait, "if you press left or right you can see my letters or recipes"},
{phoebe_portrait, "and the drawer where i keep ingredients is up top."},
{phoebe_portrait, "you can press ❎ to back out to the workbench."},
},
function()
screen_workbench = {draw=bench_draw, update=bench_update}
change_screen(screen_workbench)
end,
screen_workbench)