Game Development Community

Splash Screen Woes

by rennie moffat · in Torque Game Builder · 04/26/2010 (8:00 am) · 4 replies

Hi am having trouble getting my splash screen to work properly. Currently when I run my game it plays the scene which is open. It fades it in, as it would the splash, leaves it up for the length determined in the splash.gui then fades it out. I am not sure what to do. I am looking at other tutorials, including looking at the gui builder. however there is a problem with that as when it asks to select bitmap, under misc there isn't one. There is a guiBtmapCtrl but that won't let me select images.


Not sure what to do
function initializeProject()
{	
   $splash = 1;
   exec("~/gui/splash.gui");               
   exec("./gameScripts/splash.cs");  
   
   // Load up the in game gui.
   exec("~/gui/mainScreen.gui");

   // Exec game scripts.
   exec("./gameScripts/game.cs");

   ///startGame( expandFilename($Game::DefaultScene) );
   
   ///startGame(%level); 
   $defaultScene = "game/data/levels/level1Pt1.t2d";
   getSplashNumber();
   loadSplash(); 
}

It does not load the default scene, even if starGame is not /// out. It does not load the splash bitmap. Just the open scene in the editor. it treats it like a Splash, fade in, fade out, but does not open the splash.


About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
04/26/2010 (10:05 am)
Hey Ren,

You most likely need to call:
startGame( expandFilename($Game::DefaultScene) );
from inside splash.cs.

So once the code runs through that does the splashing, it's finished, then call the above to start the game.
#2
04/26/2010 (10:19 am)
ok, thanks rollerJ,

I put it in as you said but it takes me to the scene currently open in the builder. not cool.



So in essence I have in the splash.cs
replaced
function loadSplash()
{
    // Load game
    if ($splash == 0)
    {
        resetCanvas();
        startGame($defaultScene);
        
    }
  ////this takes me to my mainMenu as instructed in main.cs


to
function loadSplash()
{
    // Load game
    if ($splash == 0)
    {
        resetCanvas();
       startGame( expandFilename($Game::DefaultScene) );
        
    }
//this takes me to the currently running scene in the editor.



both create a black, all black screen during the time meant for the splash.


#3
04/26/2010 (10:45 am)
$Game::DefaultScene is the last scene that was open in the editor, so if you want to open a specific scene, you need to specify that instead of $Game::DefaultScene like you did here:

$defaultScene = "game/data/levels/level1Pt1.t2d";

That file path looks suspect to me. Try echoing out $Game::DefaultScene take the result and replace the last part with the scene you want loaded.

For example if it echos out: ~/data/levels/untitled.t2d

you would want to do:
$defaultScene = "~/data/levels/level1Pt1.t2d";

and call it using:
function loadSplash()
{
    // Load game
    if ($splash == 0)
    {
        resetCanvas();
        startGame($defaultScene);
        
    }
}
#4
04/26/2010 (11:14 am)
well that code you provided is the one defaulted, or used in the tutorials. With that, it loads a blank screen and then whatever I have set as my default in my main.cs.



:????? pea-q-lee-err.