Tuesday, September 22, 2020

Bmax part 3.1

In this entry we are making the functions of the main loop.

First, we declare the functions in common.h:

declare new functions in common.h

Now to code the appSelect() function, we are using the same idea of chooseLang() explained here. However, the options offered have changed. Options now:
 - help (default answer in bracket)
 - chooseLang
 - button_dash
 - exit

After doing that, we should check everything is ok, and we don't have made any typo or something. This is made by doing the main just launch it, and printing the answer (launching nothing afterwards).

main.c to check appSelect()

With this assured, we can go to implement selectedApp():

This function is basically a column of ifs with string comparison, where each option launch a function.
It will also receive two arguments, the selected app and the language to use.


selectedApp()


If everything is correct (which it is), now we have our selection menu up and running. We can do a test with:

main.c with code to check our main menu


The only thing left now is to make the loops to keep the game running, until the user wants to exit.

No comments:

Post a Comment