View Full Version : Robot Movement

11-25-2012, 07:07 AM

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();

11-25-2012, 05:00 PM
We need more code - show us how you update the robot's location