Search:

Type: Posts; User: elamre

Search: Search took 0.07 seconds.

  1. Replies
    22
    Views
    2,280

    Re: Help with bouncing ball

    You could update the speed every timer tick, but why not update the position every tick?
    make something like an update function. something along the lines of:

    public void update(){
    x+=xspeed;...
  2. Replies
    22
    Views
    2,280

    Re: Help with bouncing ball

    That's true indeed. Now look at the line i pointed out. It will execute that every 10 ms i believe. so every once in a very short while it will execute ball.getXPoint() and ball.getYPoint(). And...
  3. Replies
    22
    Views
    2,280

    Re: Help with bouncing ball

    Try to get just 1 ball able to bounce and move properly. If you follow Norm's tips on his post, and then read what i said, you should be able to make a conclusion on what is going wrong :) .
  4. Replies
    22
    Views
    2,280

    Re: Help with bouncing ball

    Owh, well mine thought me to use this. by this. you refer to a private data field. Also i'm not quite inderstanding your code. Do you want a simple ball bouncing on the screen? If so, look at this...
  5. Replies
    22
    Views
    2,280

    Re: Help with bouncing ball

    Also another tip, instead of writing a "_" in front of every variable the class has, you could also use "this." makes everything a bit easier in my opinion. Example:


    private int speed = 0;...
  6. Replies
    22
    Views
    2,280

    Re: Help with bouncing ball

    To slow it you could always make the x and y positions a double or float i suppose and do the same for the x and y point. then multiply them by 0.1 or something. It should go slower now.
    I dont...
Results 1 to 6 of 7