ok in dev i dont know when to make a new file but when i look at yours you have one for the layout the hud and everything so when do i make a new one or could i make a complete game using one page
ok in dev i dont know when to make a new file but when i look at yours you have one for the layout the hud and everything so when do i make a new one or could i make a complete game using one page
I'm not sure what you mean, but it sounds like you're wondering about keeping different parts of a program in separate .cpp files....maybe.
Correct me if I'm wrong about any of this, but technically, yes, you can keep it all in one file. However, it can be easier to read/debug/change the program if you don't.
One of the nice things about C++ is the ability to separately compile files within the same project. If you have all of one kind of functions within a separate .cpp (and .h) file, the main function itself is easier to read and follow, which makes debugging and changing the program easier. It also lets you use those functions easily with another program. Instead of re-typing or copy/pasting the code to your new program, you can just #include the header file in the source file that contains int main(), and include the .cpp that corresponds to the header file in your project.
Just like functions make it easier to do the same calculations over and over within the same program, functions within separate header/source files make it easier to do the same calculations over and over, not only within one program, but within several different programs.
I hope that's what you were looking for....
Decrypt
There is a difference between tedious and difficult.
Very ambiguous. Would help if you clarified what you're trying to say here.Originally Posted by lilhawk2892