Game Development Community

create "press any key to continue"?

by deepscratch · in Torque Game Engine Advanced · 03/09/2009 (3:31 pm) · 3 replies

hi all,
I trying to set up a "press any key to continue" scenario at the begining of my game, where you can press a key to continue into the main game, and skip an intro cut scene/video (that I want to display at the begining of the game)
any ideas as how to set this up??
thanks

#1
03/09/2009 (4:32 pm)
Look at default.bind.cs. You'll see how it checks for action maps and creates its own (this is done in a few other scripts too). A new temporary action map is what you want to use to temporarily route all the keys to the function.

As to what would be a way to bind all the keys to one function without separate binds? I don't know...
#2
03/09/2009 (4:44 pm)
You could also have a floating GUI with a simple "click to continue" button. Check out messageboxOK in the GUIs.

//if the player is killed show this:
MessageBoxOK( "You've Had It (Unlucky Mate!)", "Leave This Mortal Coil", "disconnect();");
#3
03/10/2009 (4:01 pm)
create a floating GUI control with a button/lablel inside with the required text.
PressAKey.gui
---------------
new GuiBitmapButtonCtrl(PressAKey) {
... more setup
extent = "1024 768";
position = "0 0"
bitmap = ""; //No bitmap, this will be a large invisible button
... more setup
new GuiBitmapButtonCtrl(PresssAKeyBtn){ //A button inside your control
... //more setup
extent = "300 100";
position = "400 300"
bitmap = "./PresssAKey";
... //more setup
}
}

function PressAKey::onClick(%this) {
//do whatever you want
}

function PressAKeyBtn::onClick(%this) {
//do whatever you want
}

----------------

Now, add the control to the client/init.cs along with other guis and when the intro screen appears push the control like:
Canvas.pushDialog(PressAKey);

That way you will see your intro behind and the lage invisible button will be in front of it.

Just an idea.

Luck!
Guimo