Posted: Tue May 31, 2011 9:07 pm Post subject: Player Controls
What is it you are trying to achieve?
<I'm trying to make an option in my bomberman game so that you may change the controls of a player because certain people have certain preferences. I was just wondering if somebody could give me some base code and/or explain to me how to do this since I have tried and failed miserably so I'm am turning to the good people of comsci for help>
Sponsor Sponsor
DemonWasp
Posted: Tue May 31, 2011 11:33 pm Post subject: RE:Player Controls
Right now, you probably have some code that looks like the following, assuming you're using Input.KeyDown():
Turing:
if keys ('a')then % go left because player pressed A endif
You should change it to:
Turing:
if keys ( control_left )then % go left because player pressed left endif
Then you need to have a separate settings file that your program can read. Then you need a way for a human to change the file. Either it should be possible to change the file manually (human-readable), or your program should be able to change it for the user (or both).
Raknarg
Posted: Wed Jun 01, 2011 10:19 am Post subject: RE:Player Controls
If you wanted to have a choice between arrow keys and chars, you would use 2 if statements.