Generating bitmaps by chance
<p>How can I make a piece of code that will generate me my bitmaps by chance. I want a 50% chance for bitmap1, 50% for bitmap2 and 20% for bitmap3. Can I get some advice on how to do that?</p>

<p>I know how to do it for fifty-fifty:</p>

<pre><code>Random r = new Random();
int randBall = r.nextInt(2);

if (randBall == 0) {
   return Gball;
} else if (randBall == 1) {
   return Bball;
}
</code></pre>

<p>But if I want to add one more ball with a 20% chance of spawning, I don't know how to do that.</p>
