Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    If the code changes the position of the shape too often, the speed will be high.
    How often does the position change?
    For example if in the beginning the position was changed every 1 second and...
  2. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    Did you look at times when the changes in obstacleX happens? Is it change more frequently to make it move faster?

    For testing change the width/distance the shape moves to 100 from 600 so the...
  3. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    Ok. Why does the code subtract 0.1 when the change is always 1?

    Now what about the times when the changes are made?

    For example if a shape's position is changed by 10 units every 10 seconds...
  4. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    Please post the print out for the values of obstacleX.

    You skipped this question:
    What about the time between moves? Does the time decrease?
  5. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    If the distance between positions changes at a constant rate,
    Then what about the time between moves?

    See the formula in post#6
  6. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    The formula for speed = distance / time
    The speed will increase if the distance goes up and/or the time goes down
    Which of those two values are changing?


    I have no idea what that means. Do...
  7. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    What did the print outs show?
  8. Replies
    18
    Views
    969

    Re: Rectangle keeps getting faster

    Try debugging the code by adding some println() statements to print out changes to the variables that control the speed of the rectangle. The print out should show you where the code is going wrong....
Results 1 to 8 of 8