Avoid multiple inputs ?

Hi !

First excuse me for my bad English level ;D
I’m trying to make a RPG with Slike2D, so I want my player can only move on the x and the z axis, but with this code:


    public void update(GameContainer gc, int delta) throws SlickException
    {
        Input input = gc.getInput();
        if(input.isKeyDown(Input.KEY_S))
        {
          player.Down();
        }
 
        if(input.isKeyDown(Input.KEY_Q))
        {
        	 player.Left();
        }
}

I can move him diagonally with S and Q for example :frowning:

Any solutions to remove this features ?
Thx

Make the second “if” an “else if” !

Thx a lot ;D