I thought that i somehow had to declare a flow for the engine: what handles the fact that from a splash page you go to a menu, to a main screen, to a help screen, etc ?

Pages.

I declared that a page is an entity which holds one or more consoles.
libtcod allows to create one or more “off-screen”consoles.
I don’t know if i’m using them in the correct way, but after some time of tests, this is one of the results:

consoles

What happens here on the left?

I created a page which holds 3 consoles, each one with its position and size.

In the page setup i define the background and foreground colors,and other attributes (like for example if the console has the frame or not)

In the end i have a structure which holds 3 different named consoles.

From the main engine i can now access them and “write” on screen with a command like: write(“consolename”,x,y,text)

And here i go: i have consoles ,pages related each one to another and a control flow!

And more to come has already been made, but that’s for another post.

Advertisements