With the first one, even though you would press up, the second if will be checked. In the second case, it only happens is the first returned false. So I would go for the second but don't expect big changes though.

1 Reply

In my opinion, since a keyboard can handle 3 keys simultaneously, this will not have the same behavior. The first example will allow your object to go up and down, in the second one this will be go up OR go down, and if both are used, it will only go up.