Hi all,
Thank you for your reply and patience.
Assuming the following configuration:
W - move forward
A - move left
S - move backward
D - move right
Assuming you want your player to move in this way..
WWASSSDWWWWWWWWWWAAWWWWAAAASSWWDDD.... (2000 keystrokes)
(forward, forward, left, backward, backward, backward, right, forward,...)
This keystrokes are saved in a file.
The pseduo code should be something like this:
while not end of file
reading a char. into letter$
select letter$
case "W"
; codes for moving forward
case "A"
; codes for moving left
case "S"
; codes for moving backward
case "D"
; codes for moving right
end select
wend
Later, you change your mind, you want this:
SWSDDSSDASSSSSSSSSSDDDSSSWWWSSDDD........ (2000 keystrokes)
(backward, forward, backward, right, right, ...)
With virtual key, you do NOT need to change a
single line of code. You just change the file content
with keystrokes, then ok.
It seems that with other method mentioned,
I have to change large amount of codes to do
the same thing.
This is how I understand the use of virtual key.
Thanks in advance.
Sammy
:)
Thank you for your reply and patience.
Assuming the following configuration:
W - move forward
A - move left
S - move backward
D - move right
Assuming you want your player to move in this way..
WWASSSDWWWWWWWWWWAAWWWWAAAASSWWDDD.... (2000 keystrokes)
(forward, forward, left, backward, backward, backward, right, forward,...)
This keystrokes are saved in a file.
The pseduo code should be something like this:
while not end of file
reading a char. into letter$
select letter$
case "W"
; codes for moving forward
case "A"
; codes for moving left
case "S"
; codes for moving backward
case "D"
; codes for moving right
end select
wend
Later, you change your mind, you want this:
SWSDDSSDASSSSSSSSSSDDDSSSWWWSSDDD........ (2000 keystrokes)
(backward, forward, backward, right, right, ...)
With virtual key, you do NOT need to change a
single line of code. You just change the file content
with keystrokes, then ok.
It seems that with other method mentioned,
I have to change large amount of codes to do
the same thing.
This is how I understand the use of virtual key.
Thanks in advance.
Sammy
:)