
-----------------------------------
Kodiakwarz
Tue May 31, 2011 9:07 pm

Player Controls
-----------------------------------
What is it you are trying to achieve?


-----------------------------------
DemonWasp
Tue May 31, 2011 11:33 pm

RE:Player Controls
-----------------------------------
Right now, you probably have some code that looks like the following, assuming you're using Input.KeyDown():


if keys ( 'a' ) then
    % go left because player pressed A
end if


You should change it to:


if keys ( control_left ) then
    % go left because player pressed left
end if


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
Wed Jun 01, 2011 10:19 am

RE:Player Controls
-----------------------------------
If you wanted to have a choice between arrow keys and chars, you would use 2 if statements.

if key (KEY_LEFT_ARROW) or key (KEY_RIGHT_ARROW)  or key (KEY_UP_ARROW)  or key (KEY_DOWN_ARROW)  then
     % set keys here as arrow buttons
else
     % set keys here as letters
end if

Chars and KEY_LEFT_ARROW aren't interchangable (as far as I know), so its a bit more difficult to use them at the same time.

-----------------------------------
Raknarg
Wed Jun 01, 2011 10:21 am

RE:Player Controls
-----------------------------------
You could even make it simple and ask the user for their key preference (either arrows or WASD).
