Game Development Community

Remapping Keys? Or is double mapping an issue?

by Chris Jorgensen · in Torque Game Builder · 10/03/2006 (10:38 am) · 4 replies

I'm curious if I I should re-map keys or just double map keys. Here's my game setup:

1- splash screen: user uses mouse to select wich gameplay mode
2- select screen: here each of the 4 players can select their ships, which level to play, and which input device is associated with each player with the mouse

I'd like it such that if player one selects "keyboard for his input device that the keys then do 2 things:

1- control the ship select cursor on the selection screen; basically, there's a grid of ships... he can use the keys to move a select box over the one he wants, hit enter, and that ship is selected for him.

2- control the ship in game

Now I have key mappings working for both of these. Is it better to just map each arrow key twice? Or should I somehow wipeout the select screen mapping and load the ship control mapping once the actual gameplay starts?

#1
10/03/2006 (10:58 am)
Use two different ActionMap objects. You could call one 'menuMap' and one 'moveMap' (as it is called by default). Just pop the menuMap and push the moveMap when you are entering gameplay. Do the opposite when transitioning from gameplay back to menu. There is some stuff about action maps on TDN and in Maurina's GPGT.
#2
10/03/2006 (11:19 am)
^Ah, cool! I hadn't thought of that. I'll try it out. Thanks :)
#3
10/04/2006 (10:10 am)
Works perfectly. I'm not sure why I didn't think of it. And sure enough the documentation says the same thing. Thanks!
#4
10/04/2006 (12:24 pm)
Glad you got it working!