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

2012/4/18

If the time is on how can I go to the hiscore

1
2
danpost danpost

2012/4/18

#
Use the original code that you posted at the beginning of THIS discussion and change line 16 to the following
((Background) getWorld()).gameOver();
and remove line 17.
danpost danpost

2012/4/18

#
Another way would be, again remove line 17, but replace line 16 with 'getWorld().removeObject(this);'. Then in the Background act() method add 'if (getObjects(TimeChecker.class).isEmpty()) gameOver();'.
IsVarious IsVarious

2012/4/18

#
It's important when you're writing code, to test as you go. If you think you know how you want a method, if statement, class, ect to work. You'll want to test them piece by piece, and part by part. Then put them all together. This makes errors easier to spot and your debugging is much faster.
martijn13039 martijn13039

2012/4/19

#
thx it works great now
davmac davmac

2012/4/19

#
So you already have a gameOver() method in another class? You should have explained this at the beginning - it would have made it much easier to help you.
martijn13039 martijn13039

2012/4/19

#
Oké sorry for The problem
You need to login to post a reply.
1
2