PDA

View Full Version : Recursive and Iterative Walk Methods


collegeconfused
04-08-2013, 04:46 PM
Im using the he-builder to design a method for an assignment. The assignment is to make two different methods (see title) that will make a character walk to an object. The he-builder has a preset method for walking but it is based on the amount of time. How do i make both types of methods to walk to a specific object?

chickentree
04-09-2013, 12:26 PM
Im using the he-builder to design a method for an assignment. The assignment is to make two different methods (see title) that will make a character walk to an object. The he-builder has a preset method for walking but it is based on the amount of time. How do i make both types of methods to walk to a specific object?

The s/he builder walk method does not move the person, it only makes the object go through the motions of walking. So you need to write two methods, one using recursion and the other iteration each takes an object parameter and causes the s/he to walk to the given object.