Consider a simulation of an energetic monkey, imbued with super-powers as the result of
a bite from a radioactive spider -- a "Spider-Monkey" if you will -- with said monkey located in a somewhat compressed and scaled-down representation of Manhattan island, measuring approximately 5km by 2km.
Project a 5km x 2km ellipse (covering most of simulated Manhattan) onto the unit circle.
Take the vector representing the monkey's position in the Manhattan circle, and the unit vector representing the monkey's forward facing in world space.
The
dot product of the two vectors is a convenient positive indicator of whether forward movement is likely to result in the monkey falling into the Hudson or East Rivers.
Using that value as an input to the
monkey simulation is left as an exercise for the reader.