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

2018/4/4

Chapter 9 Asteroids Using java.util.List

pleasehelp2018 pleasehelp2018

2018/4/4

#
hi all, I would like to ask how do you use a list in greenfoot chapter 9? Exercise 9.70 Add new asteroids when all have been cleared. Maybe the game should start with just two asteroids, and every time they are cleared away, new ones appear, one more every time. So in the second round, there are three asteroids, in the third round four, and so on.
danpost danpost

2018/4/4

#
pleasehelp2018 wrote...
I would like to ask how do you use a list in greenfoot chapter 9? Exercise 9.70 Add new asteroids when all have been cleared. Maybe the game should start with just two asteroids, and every time they are cleared away, new ones appear, one more every time. So in the second round, there are three asteroids, in the third round four, and so on.
For what purpose do you need to use a list? What have you tried? Show attempted code/effort.
pleasehelp2018 pleasehelp2018

2018/4/4

#
learn how to use list and getObjectsInRange but no work public void leftover() { List<Asteroid> leftover = getObjectsInRange(50, Asteroid.class); }
danpost danpost

2018/4/4

#
pleasehelp2018 wrote...
learn how to use list and getObjectsInRange but no work << Code Omitted >>
I do not see how that is going to help for the current exercise. Explain your intentions with using a list here. Also, explain why you think getting the asteroids within some proximity of another actor is going to help.
You need to login to post a reply.