1 decade ago by coreysnyder
In my game Zombie Ops I'm not at all happy with how the zombies movement is done. I want it to be more natural and not have zombies walking 1 direction and then on their directionChange() method doing a 180. They currently move using the basic entity this.velocity.x and this.vel.y;
The count at which they change direction is a using a timer every 2 seconds.
What I want when this method is called is to...
* Determine the current angle based on Velocity X/Y
* Modify that angle by a random number of degrees between say.. 10 and 30
* Convert that angle back into X/Y Velocities
I believe the end result would be my zombies walking more... zombie like. Where once they start moving in a direction they would only making some changes to that direction. They should still be able to pull a 180, but not in a single step, but rather after many steps.
To anyone who can help, I'd be happy to provide iOS promo codes for some of my games. Also a huge "Thank you!"
Cheers,
Corey
The count at which they change direction is a using a timer every 2 seconds.
What I want when this method is called is to...
* Determine the current angle based on Velocity X/Y
* Modify that angle by a random number of degrees between say.. 10 and 30
* Convert that angle back into X/Y Velocities
I believe the end result would be my zombies walking more... zombie like. Where once they start moving in a direction they would only making some changes to that direction. They should still be able to pull a 180, but not in a single step, but rather after many steps.
To anyone who can help, I'd be happy to provide iOS promo codes for some of my games. Also a huge "Thank you!"
Cheers,
Corey