🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

A execution flow contains only TIC method?

A topic by alrado created 199 days ago Views: 193 Replies: 9
Viewing posts 1 to 3

For example, Pico-8 there are several methods: _draw (), _init (), _update (), _update60 ()

It may be worth adding method INIT?

I do in this way:

t=0
function INIT()
trace(''..t)
t=t+1
end

INIT()

function TIC()
trace(''..t)
end

note that INIT can have the name you prefer.

Developer(+1)

sorry, didn't see that you already answered :)

Luckily we said the same thing :D

(but you formatted it better)

Thanks for the help!

Developer

If you want INIT func, just declare and call it before TIC function.

function init()
    t=0
end

init()

function TIC()
    cls(12)
    print("HELLO WORLD!",84,64)
    t=t+1
end

I designed the app to use with only one TIC function which calls 60 times per second.

That is, any methods that are declared and call before TIC function will work. Understood thanks!

Sorry for offtopic, but how you are can format the code? It may have some tag for formatting LUA code?

Developer

just go to 'Formatting' and select 'Code' on the toolbar

Thanks!