This entry is part 7 of 37 in the series Java Applet - Game Development

Learn Java 2.7- Game Applet- Adding Friction

Learn Java 2.7- Game Applet- Adding Friction

In this java game applet tutorial, we will add some friction to our ball which will make the motion more realistic.

If you have any programming questions, or just want to make some new friends, check out our forum at http://www.mybringback.com/forum.

All of our tutorials are also located at http://www.mybringback.com/tutorials

Also, if you want some other things to do, like us on facebook, and follow us on twitter @mybringback.

Previous Lesson
Next Lesson

Tagged with →  

One Response to Learn Java 2.7- Game Applet- Adding Friction

  1. Achref says:

    Really nice tutorials man, well done! Although if you want to stop the ball from shaking on y, you can add in
    if(y==this.getHeight()-radius-1)
    {
    dx*=xFriction;
    if(Math.abs(dx)<.8){
    dx=0;
    }
    }
    this
    if(y==this.getHeight()-radius-1)
    {
    dx*=xFriction;
    if(Math.abs(dx)<.8){
    dx=0;
    }
    if(dx==0){
    dy=0;
    }
    }
    That will make it completely stop.

Leave a Reply