I need help adding a variable to a menu. I've created simple menus that I can add plain text to with "", but I have no idea how to add a variable to that menu.
Context is that the variable is a hunger meter that will go down periodically. I want the menu to display the current number of hunger.



If the variable is a number, than using the .. operator will work. Its main purpose is combining text, but numbers will be automatically converted to text when combined with text.
For example:
h = 5 t = "Your hunger is "..h print(h) |
should result in printing "Your hunger is 5"



hey @Mondast,
it would be helpful if you post a pic or even a cart( In this post is my first try to post a cart :D , so we know what's your goal to do.
There is a "preview" button under the posts, and there you find "Formatting help" and "add image" "add cartridge" where you upload a pic/cart.
Try to read something about tables (pico-8) or array/list (other programm language)
I use tables (arrays) quite often, and with unpack() you can create readable code, I guess. but i'm a noob, might create other problems.
I found this unpack like here https://www.lexaloffle.com/bbs/?pid=100436#p
Here is some code,that creates a box, a bar changing with time an two barschanging with the buttons x,o. And an animal changing with to much hunger.
Might be to much, but i'm still learning pic0-8 and helping in forums ;)
[Please log in to post a comment]