This site requires JavaScript, please enable it in your browser!
Greenfoot back
iCodeAsian
iCodeAsian wrote ...

2015/11/12

Help me please.

iCodeAsian iCodeAsian

2015/11/12

#
I need to add coloured stars and different sized stars for Asteroids chapter 7. I need this by tonight because it's due tonight and I have no clue how and my teacher wont help..
Super_Hippo Super_Hippo

2015/11/12

#
Isn't the other thread you created about the same topic?
iCodeAsian iCodeAsian

2015/11/13

#
@Super_Hippo No. This I need different sized stars for which i have no clue how to do.
iCodeAsian iCodeAsian

2015/11/13

#
@Super_Hippo Can you help with that?
Super_Hippo Super_Hippo

2015/11/13

#
It is still related to the same code. You have this line:
background.fillOval(x, y, 2, 2);
In order to have different sized stars, you could get a random number instead of the '2'. So for example:
final int r = 1 + Greenfoot.getRandomNumber(6);
background.fillOval(x, y, r, r);
You need to login to post a reply.