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

2021/1/16

Making a method available in multiple projects

SliderG SliderG

2021/1/16

#
A lot of my different games end up reusing ideas from each other. Currently, that means a lot of copy and paste of methods from classes in one project to classes in another project. Is there a way to make a method that is available to all my projects? Can one modify the Actor and World classes that come with Greenfoot?
danpost danpost

2021/1/16

#
SliderG wrote...
Can one modify the Actor and World classes that come with Greenfoot?
You could create extensions (subclasses to World and Actor)and then place them where they can be imported into projects when needed. You would then have your World and Actor classes extend them. Alternatively, but not something I would really suggest doing, is modifying the new class default code files found at: greenfoot/lib/english/greenfoot/templates
You need to login to post a reply.