Game Development Community

Does anyone have any object-movement functions such as move object randomly?

by Adam Emrick · in iTorque 2D · 11/13/2011 (7:24 pm) · 0 replies


It seems like, to use as an example, moving the object randomly would be a very common function. Something like
1)Choose a random direction
2)Check for obstacle or world limit, if so, choose another direction
3)Move in that direction
4)Randomly change direction again at specified random time interval

I was just wondering if anyone would be willing to share some movement functions for objects, or point me in the right direction.

Just trying to avoid the pitfall that most software developers succumb to of re-inventing the wheel.

Thanks guys