Hi guys,
A snippet out of something I'm tinkering with. My first attempt at tinkering with pico-8 source so excuse if it's a novice question.
EDIT = 1
EDITTEXT = {}
ADD (EDITTEXT,"NO")
ADD (EDITTEXT,"YES")
FUNCTION _UPDATE()
IF (BTNP(5)) THEN EDIT = EDIT + 1 END
IF EDIT > 2 THEN EDIT = 1 END
END
FUNCTION _DRAW()
PRINT("BUTTON(2) - CLEAR:"..EDITTEXT(EDIT),10,20,3)
END
I'd have dumped the whole listing in as a screenshot gif but not really sure how to do that yet. This example should be toggling no or yes when I hit the 2nd fire button but just gives me a syntax error.
I know I should be able to init it with EDITTEXT = {"NO,"YES") or is it (No,Yes) ???
Basically trying to output a string in a collection within a print line.
Thanks.
[Please log in to post a comment]