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

55 lines
1.5 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 = pages[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(-10-outwards_x, 8+outwards_y, 128, 128)
draw_letter_on_paper(letters[letter_idx], 4-outwards_x, 12+outwards_y)
draw_drawer()
end
screen_workbench = {draw=bench_draw, update=bench_update}
if not testing then
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, [[then press ❎ to get back to the workbench.]]},
},
function()
screen_workbench = {draw=bench_draw, update=bench_update}
change_screen(screen_workbench)
end,
screen_workbench)
end