Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / My basic game setup doesn't work?

Author
Message
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 13th Apr 2009 02:29
Here is my error:



and here are my files:

game_functions.h:


game_functions.cpp:
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 13th Apr 2009 04:34
You have defined enum eGameModes more than once. Go through your program and delete the second iteration of it.

------------------------------------
Currently 900+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 13th Apr 2009 05:10
where?? i only sed this once:



then i sed eGameModes modes = eGameSetup;

???
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 13th Apr 2009 07:31
Why not use a prototype for _GameMain() in the .h file and define it in the .cpp file? That might be a problem considering that the program can only enter that code block once in the .h file because of the _game_functions_h being defined.

Try this. If it doesn't work, it's still better practice.

game_functions.h


game_functions.cpp


By the way, in your switch block, you don't need to keep on changing the value of modes. When one case statement is met, everything under it is executed until it runs into a break statement.

For example, switching a char:


If the char was an 'r' OR an 'R' the "do stuff here" block would be executed and then cut off by the break statement. The "do other stuff here" block would only be executed if the char was 'k'. Basically it's the same thing that you're doing, but it's faster.

#ifdef _DEBUG
FixBugs(All);
#endif

Login to post a reply

Server time is: 2024-11-25 14:39:30
Your offset time is: 2024-11-25 14:39:30