Game Development Community

How to structure the project/game?

by Jack Cicci · in General Discussion · 08/24/2008 (3:05 am) · 6 replies

My game starts with a splash screen and then a MainMenu, both created by using different GUI on the Level1; from MainMenu i start game by calling the MainScreenGui.

Is the right solution? or is better create a Level0 (that calls only SplashScreen & MainMenu) and then loading Level1 (the real game)?
This second solution let me simply initialize the level (for example a timer) using "onLevelLoad" statement; with the first solution i dont know how to do...

Link to some project/example with MainMenu & Multiple Level?

Thanx

#1
08/24/2008 (2:36 pm)
Hi Jack,

Which product are you using?

Try following the script on one of the demos that ships with the product. It's a fairly convoluted path, but it will give you a great view of the directory structure and why things are separated as they are.

In TGE/TGEA for instance, you'll see that the demos start by calling a GuiFadeInBitmapCtrl defined in StartupGui.gui. That fades in the GarageGames logo, then loads in the game's custom splash/menu GUI. That game-specific menu jumps into the game proper.
#2
08/24/2008 (5:29 pm)
Ops... sorry... i forget that important detail...

I'm using TGB 1.1 (& i'm newbie...)

I've understood directory structure used in TGB...

All demos included in TGB haven't MainMenu or Multiple Level and so is difficult to understand the structure that "rules" on the game...

perhaps i'm confused on the right use of "level" and "scene"...

For example, in MainMenu i press "start button" and i jump in the game proper; but MainMenu & "game" stands on the same level? is my choice?

When is useful to define a new level? and what about defining new scene?

thanks
#3
08/24/2008 (7:04 pm)
A level is a *.t2d file, which is created in the editor when you save. A scene, well that's probably short for t2dSceneGraph, which is the object/class that knows how to load level files, create the t2dSceneObject's defined in the file, process ticks (elapse time), etc.. A t2dSceneGraph also has a t2dSceneWindow associated with it usually, the scenewindow is what handles rendering the scene.

A level is just a collection of t2dSceneObjects that can easily be "loaded" into the sceneGraph all at once. So that is what it is useful for. As for "defining a new scene", you probably don't need to do that. The t2dSceneWindow is called sceneWindow2D by default, and you can get the scenegraph associated with it by sceneWindow2D.getSceneGraph(). If you want a splitscreen style game you might have more than one sceneWindow but only one sceneGraph, an example.

Also, why are you using TGB 1.1, that is an ancient version. Download the latest which is 1.7.4 i believe.
#4
08/25/2008 (2:17 am)
Thank you very much...

now it's more clear...

I realize that i was confusing "level" and "scene" as 2 different way to define t2dSceneGraph, instead, if I understood correctly, level is only the physical container (file) of all object used/called in the scenegraph...

Now i'm trying TGB 1.7.4 Trial; I noticed that on its mainmenu-->File, the "new level" options of version 1.1 has been replaced with "New Scene"; but its do the same thing as "new level"... More clear on this new version...


im using that old version because its what my university bought some time ago...

Thanks
#5
08/25/2008 (3:11 am)
The Breakout Tutorial (on TDN) is an excellent example that you should look through.

It starts by building a simple game level, and later adding additional levels and a main menu. You have a score and lives that carry from one level to the next, and later levels are locked until early ones are completed.

It includes addition of music and sound effects as well as text. It's the best "how to make a WHOLE game" tutorial that I've seen.

I believe it also contains a brief explanation of "level" vs "scene" in the T2D sense as well :)

Intended as a 7-part tutorial, the first 5 parts are available and the last 2 are still in the works, but it gives you plenty to learn from. It does NOT include fading splash screens, but you've already figured that bit out, and there are a couple of tutorials that will show you where that needs to go in relation to the rest of your game.
#6
08/25/2008 (4:35 am)
Thanks Shaz...

I go immediately to see...