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

2019/3/29

Making a scoreboard

mumzel mumzel

2019/3/29

#
Hey! I am currently working on the greenfoot book and I am stuck at chapter 9 (asteriods), question 9.69 where you are meant to supposed to add a counter? Could someone help me a bit, having trouble doing it because I am new to programming.
Super_Hippo Super_Hippo

2019/3/30

#
I don't know what question 9.69 is or how exactly the code looks (I am looking at asteroids-3 right now, so the counter is already there, just not functional). You have the space, the rocket, bullets and asteroids. The world instance should create and add a counter to the world (to itself). It should also keep a reference to this counter. Then, when you want to add points to the counter (e.g. a bullet hits an asteroid), you get the reference to the counter from the world and add one point to the counter.
You need to login to post a reply.