E
Emberex
Guest
I have tried my best to figure this out, and maybe I don't quite understand collisions as well as I thought. I have these "Humans" wandering around in the wander state. I need them to know collisions not to run into. Here is my most recent attempt. What am I not understanding?
GML:
case hStates.wander:
//Wander Mode
wanderCounter += irandom(5);
if(wanderCounter >= 3*room_speed){
if(place_free(x + hSpeed,y + hSpeed)){
direction = wanderRadius;
speed = hSpeed;
}
if(wanderCounter > 5*room_speed){
wanderCounter = 0;
wanderRadius = irandom_range(0,360);
}
}