Hi,

I am new to the OpenGL world. I want my robot to move right and left.

It should move Right I press some key say (R) -->Right
It should move Left if I press (L)
I have been trying to do the code but it doesn't work. Have a look at my code and tell me what's wrong with it

if (Keyboard.isKeyDown(Keyboard.KEY_R)) {
moveRobotRight += 0.1*getAnimationScale();
}

else if (Keyboard.isKeyDown(Keyboard.KEY_L)) {
moveRobotLeft -= 0.1*getAnimationScale();
}