You are not logged in.
If i didn't do anything wrong (once more) it do compile at least...
This code is till returning bools as ints which does work, but is slightly confusing since generally 0 is a good exit condition, but that is false.
Also, you compare to NULL but return 0 for pointers, it's generally nice to be consistent.
Do a quick review of your return types, return values, and use of "true" and "false".
Offline
Thanks toffyrn, thats some really useful stuff there xD
Good call on the main() - i have been looking into the whole object thing and needed to rewrite it, but i figured since im going to have so much of it changed when the ai functions get placed, that i might aswell leave it till last.
Still, it did help me get my head round the use of objects somehow
Also, it still wont compile:
monolith.cpp:40: error: expected initializer before 'exitState'
monolith.cpp:42: error: 'temp' was not declared in this scope
monolith.cpp:58: error: expected ';' before 'return'
:C
Another edit: some general cleanign of return types, should be clearer now (I hope)
WAIT, nvm, I fixed it -> missing some semi-colons... Yeah.. I know..
Last edited by GalacticArachnid (2010-05-13 22:30:33)
Offline
One last thing:
THANK YOU ALL! You have really helped not just with that one set of code, but with my progress to understanding C++ in general
Offline
Also, that global screen you've got at the top of your .cpp file could be put inside the class for better encapsulation. If you need to access it outside the class, you can make a getter method for it.
Offline