Creating New Methods -
12-20-2010, 09:46 PM
I have a question that will probably seem elementary, but I am a just beginning to learn the rules of programming.
I'm creating a world with three objects -- a frog, a bunny, and a hampster -- and they are interacting with each other.
My question relates to creating a new method that involves a single action by two of the objects, as seen here:
frog.head point at bunny.upperBody.head duration 0.5 seconds
hampster.head point at bunny.upperBody.head duration 0.5 seconds
Is creating new methods reserved for multiple actions of ONE object, or am I alright with combining the actions above for two objects into a method since they repeat?
Thanks,
Tim S.
|