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

2012/6/4

removedFromWorld

1
2
SPower SPower

2012/6/6

#
I'm sorry, I know what the bug is. Replace:
getWorld().removeObject(...);
By this:
world w = (world) getWorld();
w.removeObject(...);
That should work, if the removedFromWorld is done correctly. And some useful advice: start the name of your classes with a uppercase, that is standard in java. Java won't complain when you don't do it, but it confuses other programmers.
USBest USBest

2012/6/6

#
Well... My other classes starts with an uppercase... But the class 'World' already exists, and so I called it 'world'. ;) Thank you very much for your help! It works now! :)
davmac davmac

2012/6/6

#
I'd suggest though that you're just going to confuse yourself (and others...) if you use 'world' as your class name. Class names in Java, by convention, start with a capital. Use 'MyWorld' if you can't think of anything more imaginative :)
SPower SPower

2012/6/7

#
USBest wrote...
Well... My other classes starts with an uppercase... But the class 'World' already exists, and so I called it 'world'. ;) Thank you very much for your help! It works now! :)
Great that it works now! And davmac, you're exactly right: I also use MyWorld sometimes :)
You need to login to post a reply.
1
2