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 / Game Structure advice needed.

Author
Message
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 15th Aug 2009 04:53
Im looking to create my game using files like subroutines.. is this possible?

For instance, id like to create a file, and put my DISPLAY commands in there, and load it when needed, Also id like there to be one for fog etc, so if i need for i just tell the program to goto that routine.

Somone suggested i use headers? is this a good way, i did have a breif play, but havent got it to work.

I think i need to tell my main.ccp to #include "display.h"

my display.h looks like this.


I get a load of errors....



I need some advice please. I think if i can master this then i can do each part like this, FOG.h SKYBOX.h etc....
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 15th Aug 2009 05:30 Edited at: 15th Aug 2009 05:38
Header files are used to define functions, classes global variables etc. They are only used at compile-time.

You can't just call a header file in a program like a batch file in the command prompt. You can call each function inside of it, which might be what you mean. But, if you want to run commands from a file dynamically, you may want to look into using LUA. It's a scripting engine and as far as I read, it will achieve what you want to do, but I have not tried it.

LUA plugin:
http://forum.thegamecreators.com/?m=forum_view&t=74095&b=5


BTW - You used parenthesis () instead of brackets {} to define your function. That is not an easy mistake to make, so I am assuming you are a beginner to C++? If you are, here's a great site to learn: http://www.cplusplus.com/doc/tutorial/

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 15th Aug 2009 05:34
thanks il take a read.

Login to post a reply

Server time is: 2024-10-01 10:31:58
Your offset time is: 2024-10-01 10:31:58