the code posted "Jeppe Nielsen" is very close to what i need, but how can i make it work for a 2d game? it is a little bit difficult to understand the creatureUpdate() function.
maybe if somebody help me to understand it i can translate to 2D.
maybe if somebody help me to understand it i can translate to 2D.