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

2013/12/20

Actor sets variable of a world he is not in

1
2
danpost danpost

2013/12/21

#
This class looks good. Are you sure the error is pointing to this class?
S_Felix S_Felix

2013/12/21

#
No. It is not like a normal error that appears in the bottom line of the classes window. Instead it is in it's own window, a small one that exactly says: It was not possible to instantiate a new world. The reason for this is usually that the world does not have a public default constructor (a constructor that takes no parameters) or that the world is not a public class. I've checked all the worlds but nothing was private, so I guess it is the "no parameters"
danpost danpost

2013/12/21

#
Try right-clicking on the Game icon (under the 'Share' button) and selecting 'new Game()'.
S_Felix S_Felix

2013/12/21

#
Oh I've already found out why. I just had to do the same thing with 2 constructors for the welt class. But anyway thank you for helping me :)
danpost danpost

2013/12/21

#
Actually, you do not need both constructors in the 'welt' class; just the one that begins with 'public welt(int img)'. You need to right-click on the Game icon and select 'new Game()' to make that the starting world.
You need to login to post a reply.
1
2