Game Development Community

Basic tutorial problem

by Paul Jackson · in Torque Game Builder · 05/16/2006 (10:47 am) · 1 replies

I have the scripting for the basic tutorial and i also copied all the images in the correct folder, but i when i go to launch "run game" see the ship next to the torque it is not there i can't figure it out here is the script maybe i am missing something.

//---------------------------------------------------------------------------------------------
// Torque 2D.
// Copyright (C) GarageGames.com, Inc.
//---------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------
// startGame
// All game logic should be set up here. This will be called by the level builder when you
// select "Run Game" or by the startup process of your game to load the first level.
//---------------------------------------------------------------------------------------------
function startGame(%level)
{
// Set The GUI.
Canvas.setContent(mainScreenGui);
Canvas.setCursor(DefaultCursor);

//moveMap.push();
//sceneWindow2D.loadLevel(%level);
setupT2DScene();
}

//---------------------------------------------------------------------------------------------
// endGame
// Game cleanup should be done here.
//---------------------------------------------------------------------------------------------
function endGame()
{
sceneWindow2D.endLevel();
moveMap.pop();
}



//---------------------------------------------------------------------------------------------
// setupT2DScene
// This function is the starting point for all game specific code.
//---------------------------------------------------------------------------------------------
function setupT2DScene()
{
// Create our scenegraph
new t2dSceneGraph(t2dScene);

// Associate Scenegraph with Window.
sceneWindow2D.setSceneGraph( t2dScene );

// Set the current camera position
sceneWindow2D.setCurrentCameraPosition("0 0 100 75");
}

datablock t2dImageMapDatablock(playershipImageMap)
{
imageMode = full;
imageName = "~/data/images/playerShip";
};
$player = new t2dStaticSprite() { scenegraph = t2dScene; };
$player.setPosition("-35 0");
$player.setSize("14 7");
$player.setImageMap(playershipImageMap);

#1
05/16/2006 (2:58 pm)
Stick the last 4 lines at the end of the setupT2DScene() function. That should work then.