Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

You could make the code much more compact like this, it depends whether you really want to show the state names in text:

state = 1
statenames={'One','Two','Three'}
function TIC()
    cls(0)   
    if btnp(4) then
        state=state+1
        if state==4 then state=1 end
    end
    print(statenames[state],0,0)     
end
State names might be 'menu', 'play', 'game over' or 'attack', 'flee', 'defend' etc :D

Thanks for the pointer! I'm learning both Lua and TIC-80 as I go.

Great, good luck!