Game Development Reference
In-Depth Information
Listing 5:
Using
else if
to restrict the reading on one key and give priority to specific keys over others
All of what we have seen with arrows applies to all other keys as well. All you have to do
is to pick the key you need from
KeyCode
enumerator. You can see the result in
scene2
in
the accompanying project.