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

2012/5/19

Movement and Control

kartikitrak kartikitrak

2012/5/19

#
I was just wondering if it would be more efficient to control your actors from the world rather than the world class. What are the pros and cons of each?
davmac davmac

2012/5/20

#
I was just wondering if it would be more efficient to control your actors from the world rather than the world class.
That doesn't really make sense - perhaps you meant, control the actors from the world rather than the Actor class? The answer is: if you're worrying about efficiency, you're doing it wrong. Get your code working first. In general, it would be better from a design standpoint to have the logic for an actor in the actor's own class. It makes adding new actor types much easier. You also avoid having to keep lists of different types of actor in your world (or using "instanceof" to determine the actor type, urgh).
kartikitrak kartikitrak

2012/5/20

#
OOPS. Forgot to read over my post before posting it. However you got the question I was asking. Thank you.
You need to login to post a reply.