endGame() not working [SOLVED]
by Andrew H · in Torque Game Builder · 09/28/2011 (10:46 am) · 2 replies
I'm using an exit button to call the endGame() function, but it doesn't end the game. It just closes the level, leaving the window and GUI open. Why is this happening? Here's the code for the exit button:
And here's the endGame() function (it's found by default in game.cs under game/gameScripts, but here it is anyway):
new GuiBitmapButtonCtrl(exitButton) {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "320 339";
Extent = "104 39";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "endGame();";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
bitmap = "~/data/images/Main Menu/exitButton/exitButton";
};And here's the endGame() function (it's found by default in game.cs under game/gameScripts, but here it is anyway):
function endGame()
{
sceneWindow2D.endLevel();
moveMap.pop();
moveMap.delete();
}About the author
I do everything for my game company. Including the legal stuff.
Associate Scott Burns
GG Alumni