| re: Key function changing?
If you are making this game in VB6, you can (and it probably would be easiest if everyone always did) have what key controls an action stored in a variable.
Uh... that wasn't very clear. >_< Let me try again.
Say you have a control to move left, another to move right, and one to fire.
You know that every key on the keyboard has a keycode?
Well, you can have 3 variables, one for each action (move left/right, fire) - and set each of them to the keycode of the key which you want to use for that action. E.g.
ControlMoveLeft = vbKeyLeft
ControlMoveRight = vbKeyRight
ControlFire = vbKeySpace
Then, I presume you will have a main sub where all your control-handling will be done.
Where you would normally simply do
"If the current key's vbKeyLeft, move to the left..."
you do instead
"If the current key's 'whatever ControlMoveLeft is', move to the left..."
Then you can simply change one of those variables to change the control for that action, at runtime, i.e. without needing to change the game's code and re-compile.
(Actually, it may be better to store all the controls in one array - you'd just need to remember what index of the array represents what control...)
But, I don't know how to simply check if a certain key is being pressed - I only know how to look at the last one which was pressed down.
And that's one of the main reasons why I've never made a game in VB6. :P
|