Untitled

 avatar
unknown
plain_text
2 years ago
1.5 kB
5
Indexable
if(collision_point(lzrEndX,lzrEndY,obj_Wall,0,0)){
		
		if( !instance_position(lzrEndX+1,lzrEndY,obj_Wall) || !instance_position(lzrEndX-1,lzrEndY,obj_Wall))
		{
                                                                        // check if x+1 or x-1 = a NON WALL PIXEL (only Vertical walls have a non wall pixel on their left or right)
                                                                        // horizontal walls will ALWAYS have a wall pixel on their left and right.. 
                                                                        // the only conditions that this changes is when u hit a corner.. but you can filter this out by checking
                                                                        // x+1 and y+1 = NO WALL PIXEL (this is a BOTTOM RIGHT HAND CORNER)
                                                                        // x+1 and y-1 = NO WALL PIXEL (this is a TOP RIGHT HAND CORNER)
                                                                        // x-1 and y-1 = NO WALL PIXEL (this is a TOP LEFT HAND CORNER)
                                                                        // x-1 and y+1 = NO WALL PIXEL (this is a BOTTOM LEFT HAND CORNER)
			
			global.isVert       =   1;
			laserangle2         =   (angle *-1)+180;

		}else{ 

            global.isVert       =   0;
			laserangle2         =   angle*-1 ;
        }
		
	laser_length                =   length_laser;	
	break;
	}