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

2013/6/6

Passing score between world

uanimal uanimal

2013/6/6

#
hi there i have multiple worlds and want to pass the score through each world, i have spent a good couple of hours try to find examples but have hit a wall if you can help that would be greatly appreciated
Zamoht Zamoht

2013/6/6

#
Pass the score as an argument for the new world. I don't know much about your code but i guess it would have to look something like this. Greenfoot.setWorld(new Level2(score)); Then in the Level2 class you have to write something like: public Level2(int score) { //setup your level and do whatever you need to with the score }
You need to login to post a reply.