This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
DMCGames
wrote ...
2012/2/22
How do I access a method from the World?
DMCGames
2012/2/22
#
How do you access a method from the World? I am trying to use getworld().Method() but it says cannot find method.
Morran
2012/2/22
#
What is the name of your World class? Is it "MyWorld"? "CrabWorld"? Your method in the World class is probably actually in the World's subclass. Try this(assuming that MyWorld is the name of your World):
MyWorld myWorld = (MyWorld) getWorld(); myWorld.Method();
You need to login to post a reply.
X