[GREENFOOT-339] Change World template when sub-classing a child of World
If you make a scenario with a subclass of World, called say ChildWorld, then go for "New subclass" on ChildWorld (call it "GrandChildWorld"), then GrandChildWorld will be generated with a constructor that makes a {{super(600, 400, 1)}} call, i.e. a call to a super-class constructor from World. But of course, ChildWorld is unlikely to have such a constructor, so the code generated for GrandChildWorld doesn't compile. This is a bit irritating, and potentially misleading. It would especially be a problem if students are given a scenario with ChildWorld already there, and told to make their own GrandChildWorld, as the code generated would be wrong for no obvious reason to them. (This is more of a potential problem since we added support for multiple worlds.)
I think the best solution would be to generate GrandChildWorld without a super-class constructor call. It may still be wrong, but it would make more sense when it does go wrong.
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 2.4.0