You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementing functionality to read from a config/configuration file in our game
Why?
It is very beneficial in storing colors, (x, y) coordinates, or any constants inside our code to be stored outside our code in a separate configuration file, where we can easily edit it from there without the need to go into the code and keep search for it (Something like the current dialogue text that is in our code)
Config files are best practices and are used 100% of the time when working professionally, so it is a great opportunity for us to learn to work with them, and again they will assist us greatly in creating the levels
Don't know what is a config file?
Config/Configuration files are simply files that contain pre-determined configurations for our app, as mentioned before, colors, text, coordinates, etc
Expectations:
I expect what is said below to be done for EVERY constant in our code, even if they're not set to as constants in our code and are used inside setColor or setPosition or anything like that, create constants for them in the new config file and then include this config file and use the Constants, so I expect to rarely see constant values/number in our code files, they should all be outside the code in the header file (config.h), and please separate the constants inside the config.h file with comments and spaces to specify which constants are related to which components (Levels menu, dialogue box, command line etc.)
I expect a new header file that contains #defines or just const int x = 10; for example in them, an example of how this should work: Example c++ file: Example config.h file:
(As I said you can just do)
const string MESSAGE = "Hello world\n"
Example output
The text was updated successfully, but these errors were encountered:
Implementing functionality to read from a config/configuration file in our game
Why?
Don't know what is a config file?
Config/Configuration files are simply files that contain pre-determined configurations for our app, as mentioned before, colors, text, coordinates, etc
Expectations:
I expect what is said below to be done for EVERY constant in our code, even if they're not set to as constants in our code and are used inside setColor or setPosition or anything like that, create constants for them in the new config file and then include this config file and use the Constants, so I expect to rarely see constant values/number in our code files, they should all be outside the code in the header file (config.h), and please separate the constants inside the config.h file with comments and spaces to specify which constants are related to which components (Levels menu, dialogue box, command line etc.)
I expect a new header file that contains
#defines
or justconst int x = 10;
for example in them, an example of how this should work:Example c++ file:
Example config.h file:
(As I said you can just do)
Example output
The text was updated successfully, but these errors were encountered: