|
|
Re: A good project set-up?
[Re: wicked_mind]
#160169
10/11/07 21:41
10/11/07 21:41
|
Joined: Aug 2003
Posts: 7,439 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,439
Red Dwarf
|
its possible that you have not enabled a hidden XP feature that "hides" known extensions from a file. make sure you have this following option disabled in your Folder Options under the "View" tab:
"Hide extensions for known file types"
it's possible that you actually gave your file the name extension *.c.wdl if you had the hidden extension "xp feature"
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: A good project set-up?
[Re: Michael_Schwarz]
#160170
10/12/07 14:26
10/12/07 14:26
|
Joined: Oct 2007
Posts: 5
wicked_mind
OP
Newbie
|
OP
Newbie
Joined: Oct 2007
Posts: 5
|
OOOOOOØhhhh!
I should have read the help-file a bit more, I did not mention I was going to build the project from scratch...and apparantly I can just 'give' the map a script as well...
now...back to the brainstorming, I would like to ask the proffessionals here to give feedback on the current lay-out: *a "main.c" file, which will basicly only contain a menu with options and level select *a "game.c" file, which will be connected to every map of my game. This file will load the level (the name will be provided by main.c or a level itself), initialize the Global Variables ( if (levelname == "space") var FALLSPEED = 0; ) *a player.c and player.h, for everything player related *a camera.c and camera.h, for everything camera related *a enviroment.c and enviroment.h, for everything from monsters to powerups to moving platforms etc.
now for some (more) questions: *Suppose I buy A7 and publish this project, what would be the result (as for the scripts connected to maps and such) *where would I #include the player.h/camera.h/enviroment.h? in game.c right? wouldn't I be wasting alot of memory like this? *Is there some list for all available ....parameters?(don't know how to call them, stuff like %NAME%)
Thanks for all the help so far,
Last edited by wicked_mind; 10/12/07 15:36.
|
|
|
Re: A good project set-up?
[Re: wicked_mind]
#160171
10/12/07 21:54
10/12/07 21:54
|
Joined: Oct 2006
Posts: 106
i_program_games
Member
|
Member
Joined: Oct 2006
Posts: 106
|
First off I wouldn't worry about memory in regards to including .h and .c files unless you have a large file in which you use only one function. So keep similar code within similar files.
From my perspective header files in lite-c are a bit strange and I'd suggest using only one. The reason I say they are strange is that I have trouble using them the way C/C++ uses them. With C/C++ nearly every source file (*.c/*.cpp) contains a header file (*.h). However, when lite-c tries to resolve things this way the *.h file does not "bring in" the source code like a C/C++ compiler would. So, in short I'd suggest a setup similar to this:
/////////////////////////////////////// //Main File ///////////////////////////////////////
#include "globals.h" #include "controls.c" #include "playerActions.c" #include "menu.c" #include "entityActions.c"
//Etc, etc...
Chaos is a paradox consistently inconsistent.
|
|
|
Re: A good project set-up?
[Re: i_program_games]
#160172
10/15/07 20:29
10/15/07 20:29
|
Joined: Oct 2006
Posts: 106
i_program_games
Member
|
Member
Joined: Oct 2006
Posts: 106
|
The more I think about this the more I'll add: 1. Keep all MEDIA files in the root directory of your project: This includes sounds, models, levels, and sprites. 2. Plan on having ACTIONS within the MAIN script as this will allow your level designers access to your custom actions. 3. Install source control if possible I like WinCVS. 4. Use groupware if possible for tracking and maintaining the project. I like phprojekt.
|
|
|
Re: A good project set-up?
[Re: i_program_games]
#160173
10/18/07 18:27
10/18/07 18:27
|
Joined: Oct 2006
Posts: 106
i_program_games
Member
|
Member
Joined: Oct 2006
Posts: 106
|
Another tip: Create a game STATE MACHINE within the main loop for main game control like this
var vgGameState; //global variable which will hold the game state
define INIT_GAME,1; define RESTART_CURRENT_LEVEL,2; define RESTART_GAME,3;
function main() { while(1) { if(vgGameState) //if we have a game state { if(vgGameState == INIT_GAME) { //do init game stuff goto MainGoto; //don't do any further if statements } if(vgGameState == RESTART_CURRENT_LEVEL) { //do restart current level stuff goto MainGoto; //don't do any further if statements }
if(vgGameState == RESTART_GAME) { //do restart game level stuff gotoMainGoto; //don't do any further if statements } MainGoto: vgGameState=0; } wait(1); } }
Change the game state like this
function SomeFunction() { gvGameState==RESTART_LEVEL;//now our message gets across regardless of level changes. }
Chaos is a paradox consistently inconsistent.
|
|
|
Re: A good project set-up?
[Re: i_program_games]
#160174
10/19/07 20:01
10/19/07 20:01
|
Joined: Oct 2006
Posts: 106
i_program_games
Member
|
Member
Joined: Oct 2006
Posts: 106
|
Give variables meaningful names using some form of Hungarian Notation . Examples: var vMaxFireRange; //notice the small v for (variable) int nBulletIndex; //notice the "n" in front meaning int int iBulletIndex; //notice the "i" in front of which can also mean int int gnBulletIndex; //notice the "gi" meaning "global integer" ENTITY* pentMyEnt; //notice the pent meaning "pointer to entity" float fCurrentSpeed; You don't have to use Hungarian notation 100% but what you do use should be consistent and easily identify the variable type.
Chaos is a paradox consistently inconsistent.
|
|
|
Re: A good project set-up?
[Re: Nems]
#160176
10/25/07 15:25
10/25/07 15:25
|
Joined: Oct 2006
Posts: 106
i_program_games
Member
|
Member
Joined: Oct 2006
Posts: 106
|
Another tip, use defines extensively for constants,assigning skills, and flags.
Example.
if(my.skill1)//what is skill1?
#define skill1 SPEED;
if(my.SPEED)//now our code is more readable.
Also note the ALL CAPS when using defines. This as a standard practice for C/C++ coders and you may apply it here as well.
An example of enumerating array indexes
#define BEEP_ONCE 0 #define BEEP_TWICE 1
void BeepOnce() { beep(); }
void BeepTwice() { beep(); beep(); }
void* pFunctions[2];
pFunctions[BEEP_ONCE]=BeepOnce; pFunctions[BEEP_TWICE]=BeepTwice;
Chaos is a paradox consistently inconsistent.
|
|
|
|