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
Jemy
wrote ...
2021/3/17
calling a method
Jemy
2021/3/17
#
is it possible to call a method in Actor in a World Method? if it's, please help
danpost
2021/3/17
#
Jemy wrote...
is it possible to call a method in Actor in a World Method? if it's, please help
Yes -- but it must be a
public
method and it must be executed on an
Actor
of type where the method is located.
Jemy
2021/3/17
#
Please can you show me what you mean?
danpost
2021/3/17
#
Jemy wrote...
Please can you show me what you mean?
As an example:
Actor actor = new SomeActor(); actor.setImage("beeper.png");
Note the line 2 calls the
Actor
class method,
setImage(String)
, on an
Actor
type object,
actor
.
You need to login to post a reply.
X