Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //calc()
- //sx,sy is the top corner of the screen, dw,dh are the width&height of the screen
- //visi=0 represents invisible, visi=1 represents visible, tile=0 represents empty, tile=1 represents wall
- {
- for(i=sx;i<sx+dw;i=i+1)
- for(j=sy;j<sy+dh;j=j+1)
- {
- visi[ i , j ] = 0;
- }
- j = sy;
- for(i=sx;i<sx+dw;i=i+1)
- {
- check();
- }
- j = sy + dh;
- for(i=sx;i<sx+dw;i=i+1)
- {
- check();
- }
- i = sx;
- for(j=sy;j<sy+dh;j=j+1)
- {
- check();
- }
- i = sx + dw;
- for(j=sy;j<sy+dh;j=j+1)
- {
- check();
- }
- }
- //check()
- {
- cx = px;
- cy = py;
- d = point_direction( cx , cy , i , j );
- for(k=0;k<point_distance( cx , cy , i , j );k=k+1)
- {
- fx = round( cx + lengthdir_x( k , d ) );
- fy = round( cy + lengthdir_y( k , d ) );
- visi[ fx , fy ] = 1;
- if tile[ fx , fy ] == 1
- {
- exit;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement