Smooth Movement

1 reply [Last post]
Offline
Joined: 11/18/2012

How to make the object move smoothly just like the example in fox vs. tux?

 

thank you for answering my questions and always helping me

Offline
Joined: 12/13/2010
Can't really give this away,

Can't really give this away, but the trick is not to have the object change direction with every move() call, but only change direction after a specific number of steps.  Something like the following:

 

steps++;

if (steps % 60 == 0) {

   // change direction

}

// move character in the current direction