I was wondering how to make enemy shoot only if he is inside the view, and not when he is outside the view. help ?
Enemy outside view
Started by WingedSkyNinja, Dec 25 2011 05:48 PM
2 replies to this topic
#1
Posted 25 December 2011 - 05:48 PM
#2
Posted 25 December 2011 - 06:47 PM
GM8 and higher
on create,
inview=true;
on Outside View 0
inview = false;
on Boundary view 0
inview = true;
to shoot, check again the inview variable.
or, in end step
on create,
inview=true;
on Outside View 0
inview = false;
on Boundary view 0
inview = true;
to shoot, check again the inview variable.
or, in end step
if(bbox_right>=view_xview)
if(bbox_bottom>=view_yview)
if(bbox_top<=view_yview+view_hview)
if(bbox_left<=view_xview+view_wview)
{
//in view
}
#3
Posted 11 January 2012 - 01:05 PM
GM8 and higher
on create,
inview=true;
on Outside View 0
inview = false;
on Boundary view 0
inview = true;
to shoot, check again the inview variable.
or, in end stepif(bbox_right>=view_xview) if(bbox_bottom>=view_yview) if(bbox_top<=view_yview+view_hview) if(bbox_left<=view_xview+view_wview) { //in view }
Thanks a lot
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











