I am making a soccer game and I'm wondering how I can get my character to hit a ball when they make contact. Also where would the code go? Thank you in advance.
I am making a soccer game and I'm wondering how I can get my character to hit a ball when they make contact. Also where would the code go? Thank you in advance.
When building a class, behaviors of objects the class creates are described by methods (and states are represented by field values). In other words, it would be coded (as a method) in the class of the character that hits a ball.
I am making a soccer game and I'm wondering how I can get my character to hit a ball when they make contact. Also where would the code go? Thank you in advance.
When building a class, behaviors of objects the class creates are described by methods (and states are represented by field values). In other words, it would be coded (as a method) in the class of the character that hits a ball.
Right thanks mate. Is there a specific method I need to use? Or how can I find the appropriate one?
Is there a specific method I need to use? Or how can I find the appropriate one?
I do not think you quite understand. You would add and build the method yourself to give the actor that ability. Sure, you would probably call other methods within the method you create (like, in this case, isTouching or getOneIntersectingObject) and you can find all the ones provided for an actor in the Actor class API documentation.
I do not think you quite understand. You would add and build the method yourself to give the actor that ability. Sure, you would probably call other methods within the method you create (like, in this case, isTouching or getOneIntersectingObject) and you can find all the ones provided for an actor in the Actor class API documentation.
Yeah I'm not great at this at all haha. Thanks for your help mate