Good ideas for coding games? Not story but for doing the code? Good bad ugly.
Good ideas for coding games? Not story but for good ideas when writing the code like using classes ect? Good bad ugly.
Cory Fisher
Favorite Quotes:Gandalf: You cannot pass!|Smeagol: We don't need you!|Sloth: Hey you guys!|
quote: Original post by SSJCORY
Not story but for good ideas when writing the code like using classes ect? Good bad ugly.
Do you mean these?
"after many years of singularity, i'm still searching on the event horizon"
No, those were just specifics for the beggining of my game, I want to know what is good for all games in general.
Cory Fisher
Cory Fisher
Favorite Quotes:Gandalf: You cannot pass!|Smeagol: We don't need you!|Sloth: Hey you guys!|
Good: Writing clean, well-commented code. Designing classes thoroughly before you code them (if you are using OOP).
Bad: Using gotos to make incomprehensible code.
Ugly: Asking vague semi-questions that don''t have a snowball''s chance in hell of being answered to your satisfaction.
Bad: Using gotos to make incomprehensible code.
Ugly: Asking vague semi-questions that don''t have a snowball''s chance in hell of being answered to your satisfaction.
January 16, 2003 01:47 PM
"Good game code" in general? Worry about just plaing good CODE first, then worry about good GAME code. Some suggestions on good code:
Indent! Whenever you start a new block of code, indent all code after.
Spaces! Whenever you have an operator, put spaces between the operator and its operands. An operator is, of course, these: +, -, *, /, <<, >>, %, &&, ||, &, |, <, >, =, ==, >=, <=, !=, etc... Operands would be the data that operators ''operate'' on. The ''+'' operator would operate on the two operands to either side. So your statements should look like this:
Not this:
without spaces, it''s hard to tell what''s going on.
Also, in classes it is consider improper to have public variables. This is based on encapsulation: the programmer who uses your class shouldn''t know what''s inside.
Use structs if you don''t use methods and all the data is public.
If you need more help, just look at the layout of other people''s code.
Indent! Whenever you start a new block of code, indent all code after.
int main() { if(something) { while(somethingelse) { // do something } } return 0;}
Spaces! Whenever you have an operator, put spaces between the operator and its operands. An operator is, of course, these: +, -, *, /, <<, >>, %, &&, ||, &, |, <, >, =, ==, >=, <=, !=, etc... Operands would be the data that operators ''operate'' on. The ''+'' operator would operate on the two operands to either side. So your statements should look like this:
cout << "See all the pretty spaces!\n";cout << one << " plus " << two << " equals " << (1 + 2) << ".\n";
Not this:
cout<<"See all the pretty spaces!\n";cout<<one<<" plus "<<two<<" equals "<<(1+2)<<"\n";
without spaces, it''s hard to tell what''s going on.
Also, in classes it is consider improper to have public variables. This is based on encapsulation: the programmer who uses your class shouldn''t know what''s inside.
Use structs if you don''t use methods and all the data is public.
If you need more help, just look at the layout of other people''s code.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement