This content has been marked as final. Show 3 replies
UMihnea wrote:It's not immediately related to the problem you report but note that you shouldn't create new Random objects all the time. It should be sufficient to create just one Random object (or a few at the most in different parts of the applet).
Hello, I'm new to this Java Forum (and also in Java). I am working on a game applet and I need a random moving algorithm, that's what I've coded:
It does nothing. I placed it in run(), and I also tried it as a function (as well called in run() ). Can someone help?
Random RGen = new Random(); PlayerX += RGen.nextInt(30); PlayerY += RGen.nextInt(30);