Results 1 to 2 of 2

Thread: Robot Movement

  1. #1
    Newbie Newbie
    Join Date
    Nov 2012
    Posts
    1

    Robot Movement

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

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    We need more code - show us how you update the robot's location

Similar Threads

  1. Robot Arm
    By fullybully in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-08-2016, 06:37 PM
  2. OpenGL Robot
    By sharpCode in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-14-2014, 06:36 PM
  3. Opengl Robot.c
    By riashakkoua in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-24-2012, 04:27 AM
  4. Running example code -- robot.c
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-15-2002, 08:38 AM
  5. to generate a robot
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-29-2000, 09:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean