S
stepup2000
Guest
So im making a zombie stealth game, so the zombies have to follow the player when they see the player, i did this with a collision line that is drawn towards the point they are facing. The only problem with this method is that the collision line is very thin. So basically i have to stand exactly in front of the zombie otherwise he wont see me. Does anyone know if i can make the collision line thicker so the zombie has a larger detection radius? or a different method
//set view of zombie
var view_distance = 600;
var tx = x+lengthdir_x(view_distance,image_angle);
var ty = y+lengthdir_y(view_distance,image_angle);
if (collision_line(x,y,tx,ty,obj_man,true,false)) { //checks if the zombie can see the player
if (collision_line(x,y,obj_man.x,obj_man.y,obj_wall,true,false)) = noone { // checks if there are no walls in between the player and the zombie
alert = 1 // makes him follow the player
audio_play_sound(so_zombie_growl, 1, false) //plays zombie audio
}
//set view of zombie
var view_distance = 600;
var tx = x+lengthdir_x(view_distance,image_angle);
var ty = y+lengthdir_y(view_distance,image_angle);
if (collision_line(x,y,tx,ty,obj_man,true,false)) { //checks if the zombie can see the player
if (collision_line(x,y,obj_man.x,obj_man.y,obj_wall,true,false)) = noone { // checks if there are no walls in between the player and the zombie
alert = 1 // makes him follow the player
audio_play_sound(so_zombie_growl, 1, false) //plays zombie audio
}