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

2023/1/21

Adding a method to superclass Actor directly

ChristophT ChristophT

2023/1/21

#
Hi everybody, I am a teacher and want to use Greenfoot to teach Java to beginners. In order to make coding accessible to my pupils I would like to have all Actors offer a method called setX() and setY() instead of setLocation(). I changed the Actor.java within \Greenfoot\lib\english\greenfoot\api\greenfoot but it won't show in the Greenfoot-Project-Window when right-clicking an added object. How can I make changes to the superclass Actor? To be clear: I do not want setX() to show in the BlueJ-IDE / Subclass - but I want to be able to use the method as an inherited method. Thanks a lot. Best regards Christoph
danpost danpost

2023/1/21

#
ChristophT wrote...
How can I make changes to the superclass Actor?
You cannot make changes to the Actor class directly. The greenfoot team could add those methods on a future update to greenfoot itself; but, that would be something for them to decide upon.
ChristophT ChristophT

2023/1/22

#
Thank you for your reply. At least I am not going to waste my time then. To bad, I can't do that however.
You need to login to post a reply.