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

2013/12/14

MainActor

GreenfootJoe GreenfootJoe

2013/12/14

#
Hi, I´m a very inexperienced person in Greenfoot. So is there a method or command(or something else), with which you can assign to a player a chain of command of another, or something like that? Something like a "mainActor" which has many Actors. Thanks for an answer :)) (possibly in German :))))
danpost danpost

2013/12/14

#
You will have to be more specific as to what you mean by 'a chain of command of another'. It is unclear as to what you are wanting to do.
GreenfootJoe GreenfootJoe

2013/12/14

#
I want a few of actors make nearly the same thing. But not the same time. First if this actor is picked out.
danpost danpost

2013/12/14

#
I guess you could add a field in your world class to hold an Actor object and set it to whichever actor you wish to act at the time. Have the actors only do those actions if the field holds a reference to itself. Change the actor in the field to change the 'main actor'. You should probably add a 'get' and 'set' method for the field in the world class.
GreenfootJoe GreenfootJoe

2013/12/15

#
Oke thank you for your answer. I try it:)
You need to login to post a reply.