亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? shadow.cpp

?? 一本外國人寫的關(guān)于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
////////////////////////////////////////////////////////////////////////////////

int Vision_System(int depth,         // depth of scan
                  int direction,     // direction of scan N,E,S,W
                  object *stuff,     // objects seen in scan
                  int *num_objects)  // number of objects seen in scan

{
// this function is rather complex. It is responsible for the vision of
// the player. It works by scanning a upside down pryamid of squares in
// front of the player.  The objects within this vision window will be
// returned in the objects array along withe the number of them.
// the vision window is built up by consequtively scanning rows of blocks
// in the geometry universe along with testing the objects universe for
// instances of objects. It is sort of like ray casting, but the distance
// is irrelevant and only four directions are used.  For example if the
// player was looking north and a depth of 3 was sent for the scan then the
// scan pattern would look like:
//
//       .....
//        ...
//         P
// where 'P' is the position of player and the '.' is a scanned block
// similary a scan of depth 5 to the east would like like
//      .
//      ..
//      ...
//      ....
//      ....P
//      ....
//      ...
//      ..
//      .
// note: the field of view (FOV) will always be 90 degrees
// anyway the function is basically used for the "LOOK" verb and the "GET"
// verb and I admit that the code is redundant for each case, but to merge
// it all would make it too hard to follow!

int x,y,           // used to hold current universe cell location
    index,         // loop index
    scan_level;    // current level or iteration of the scan

*num_objects=0;

// which direction is vision requested in?

switch(direction)
      {

      case NORTH:
           {
           // scan like this
           //  .....
           //   ...
           //    P

           for (y=you.y,scan_level=0; y>=(you.y-depth); y--,scan_level++)
               {
               for (x=you.x-scan_level; x<=you.x+scan_level; x++)
                   {
                   // x,y is test point, make sure it is within the universe
                   // boundaries and within the same room

                   if (x>=1 && x<NUM_COLUMNS-1 &&
                       y>=1 && x<NUM_ROWS-1 &&
                       universe_geometry[y][x]==universe_geometry[you.y][you.x])


                      {
                      // test to see if square has an object in it

                      if (universe_objects[y][x]!=' ')
                         {
                         // insert the object into object list

                         stuff[*num_objects].thing = universe_objects[y][x];
                         stuff[*num_objects].x     = x;
                         stuff[*num_objects].y     = y;

                         // increment the number of objects

                         (*num_objects)++;

                         } // end if an object was found

                      } // end if in boundaries

                   } // end for x

               } // end for y

           // return number of objects found

           return(*num_objects);

           } break;

      case SOUTH:
           {
           // scan like this
           //  P
           // ...
           //.....

           for (y=you.y,scan_level=0; y<=(you.y+depth); y++,scan_level++)
               {
               for (x=you.x-scan_level; x<=you.x+scan_level; x++)
                   {
                   // x,y is test point, make sure it is within the universe
                   // boundaries

                   if (x>=1 && x<NUM_COLUMNS-1 &&
                       y>=1 && x<NUM_ROWS-1 &&
                       universe_geometry[y][x]==universe_geometry[you.y][you.x])
                      {
                      // test to see if square has an object in it

                      if (universe_objects[y][x]!=' ')
                         {
                         // insert the object into object list

                         stuff[*num_objects].thing = universe_objects[y][x];
                         stuff[*num_objects].x     = x;
                         stuff[*num_objects].y     = y;

                         // increment the number of objects

                         (*num_objects)++;

                         } // end if an object was found

                      } // end if in boundaries

                   } // end for x

               } // end for y

           // return number of objects found

           return(*num_objects);

           } break;


      case EAST:
           {
           // scan like this
           //   .
           //  ..
           // P..
           //  ..
           //   .

           for (x=you.x,scan_level=0; x<=(you.x+depth); x++,scan_level++)
               {
               for (y=you.y-scan_level; y<=you.y+scan_level; y++)
                   {
                   // x,y is test point, make sure it is within the universe
                   // boundaries

                   if (x>=1 && x<NUM_COLUMNS-1 &&
                       y>=1 && x<NUM_ROWS-1 &&
                       universe_geometry[y][x]==universe_geometry[you.y][you.x])
                      {
                      // test to see if square has an object in it

                      if (universe_objects[y][x]!=' ')
                         {
                         // insert the object into object list

                         stuff[*num_objects].thing = universe_objects[y][x];
                         stuff[*num_objects].x     = x;
                         stuff[*num_objects].y     = y;

                         // increment the number of objects

                         (*num_objects)++;

                         } // end if an object was found

                      } // end if in boundaries

                   } // end for y

               } // end for x

           // return number of objects found

           return(*num_objects);

           } break;

      case WEST:
           {
           // scan like this
           // .
           // ..
           // ..P
           // ..
           // .
           //

           for (x=you.x,scan_level=0; x>=(you.x-depth); x--,scan_level++)
               {
               for (y=you.y-scan_level; y<=you.y+scan_level; y++)
                   {
                   // x,y is test point, make sure it is within the universe
                   // boundaries

                   if (x>=1 && x<NUM_COLUMNS-1 &&
                       y>=1 && x<NUM_ROWS-1 &&
                       universe_geometry[y][x]==universe_geometry[you.y][you.x])
                      {
                      // test to see if square has an object in it

                      if (universe_objects[y][x]!=' ')
                         {
                         // insert the object into object list

                         stuff[*num_objects].thing = universe_objects[y][x];
                         stuff[*num_objects].x     = x;
                         stuff[*num_objects].y     = y;

                         // increment the number of objects

                         (*num_objects)++;

                         } // end if an object was found

                      } // end if in boundaries

                   } // end for y

               } // end for x

           // return number of objects found

           return(*num_objects);

           } break;

      } // end switch direction

return(0);

} // end Vision_System

////////////////////////////////////////////////////////////////////////////////

int Check_For_Phrase(int phrase,int index)
{
// this function is used to test for small phrases that when extracted don't
// change the measning of a sentence for example:"look to the west" and
// "loo west" and "look to west" all mean the same thing.

// test which phrase is to be checked

switch(phrase)
      {
      case PHRASE_TO: // have we found the prep. "to"
           {

           if (sentence[index]==PREP_TO)
              return(1);

           } break;

      case PHRASE_THE: // have we found the article "the"
           {

           if (sentence[index]==ART_THE)
              return(1);

           } break;


     case PHRASE_DOWN: // have we found the prep/adj "down"
          {

          if (sentence[index]==PREP_DOWN)
             return(1);

          } break;

      case PHRASE_TO_THE: // have we found the prep. phrase "to the"
           {

           if (sentence[index]==PREP_TO)
              {
              if (sentence[index+1]==ART_THE)
                  return(1);
              else
                  return(0);
              } // end if got "to the"
           } break;

      case PHRASE_DOWN_THE: // have we found the prep. phrase "down the"
           {

           if (sentence[index]==PREP_DOWN)
              {
              if (sentence[index+1]==ART_THE)
                  return(1);
              else
                  return(0);
              } // end if got "down the"
           } break;


      default:break; // there is a serious problem!

      } // end switch

// we have failed

return(0);

} // end Check_For_Phrase

///////////////////////////////////////////////////////////////////////////////

void Print_Info_Strings(info_string strings[],char where)
{
// this function will print the info strings out of the sent array based
// on the the current location of the player i.e. bedroom, kitchen etc.

int index=0;

printf("\n");

// traverse list and print all string relating to this room

while(strings[index].type!='X')
     {

     // should this string be printed

     if (strings[index].type==where)
        {

        printf("\n%s",strings[index].string);

        } // end if this is a relevant string

     // next string

     index++;

     } // end while

printf("\n");

} // end Print_Info_Strings

///////////////////////////////////////////////////////////////////////////////

void Introduction(void)
{

int index;

for (index=0; index<50; index++,printf("\n"));

// make the screen blue with white characters
// only works with ansi driver

printf("%c%c37;44m",27,91);

printf("\n     SSSSSSSSSS  H      H  AAAAAAAA  DDDDD     OOOOOOOO  W       W");
printf("\n     S           H      H  A      A  D    D    O      O  W       W");
printf("\n     S           H      H  A      A  D     D   O      O  W       W");
printf("\n     S           H      H  A      A  D      D  O      O  W       W");
printf("\n     S           H      H  A      A  D      D  O      O  W       W");
printf("\n     SSSSSSSSSS  HHHHHHHH  AAAAAAAA  D      D  O      O  W       W");
printf("\n              S  H      H  A      A  D      D  O      O  W       W");
printf("\n              S  H      H  A      A  D      D  O      O  W   W   W");
printf("\n              S  H      H  A      A  D      D  O      O  W   W   W");
printf("\n              S  H      H  A      A  D     D   O      O  W   W   W");
printf("\n              S  H      H  A      A  D    D    O      O  W   W   W");
printf("\n     SSSSSSSSSS  H      H  A      A  DDDDD     OOOOOOOO  WWWWWWWWW");
printf("\n                                                                  ");
printf("\n     L         AAAAAAA  NNNNNNN  DDDDDD                           ");
printf("\n     L         A     A  N     N  D     D                          ");
printf("\n     L         A     A  N     N  D      D                         ");
printf("\n     L         A     A  N     N  D      D                         ");
printf("\n     L         AAAAAAA  N     N  D      D                         ");
printf("\n     L         A     A  N     N  D      D                         ");
printf("\n     L         A     A  N     N  D     D                          ");
printf("\n     L         A     A  N     N  D    D                           ");
printf("\n     LLLLLLL   A     A  N     N  DDDDD                            ");
printf("\n                                                                  ");
printf("\n     By Andre' LaMothe                                            ");


while(!kbhit());

for (index=0; index<50; index++,printf("\n"));

} // end Introduction

// M A I N /////////////////////////////////////////////////////////////////////

void main(void)
{

// call up intro

Introduction();

printf("\n\nWelcome to the world of  S H A D O W  L A N D...\n\n\n");

// obtain users name to make game more personal

printf("\nWhat is your first name?");
scanf("%s",you.name);

// main event loop,note: it is NOT real-time

while(!global_exit)
     {
     // put up an input notice to user

     printf("\n\nWhat do you want to do?");

     // get the line of text

     Get_Line(global_input);

     printf("\n");

     // break the text down into tokens and build up a sentence

     Extract_Tokens(global_input);

     // parse the verb and execute the command

     Verb_Parser();

     } // end main event loop

printf("\n\nExiting the universe of S H A D O W  L A N D...see you later %s.\n",you.name);

// restore screen color

printf("%c%c37;40m",27,91);

} // end main


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品福利一区二区三区av| 日本一区二区免费在线观看视频| 亚洲二区在线观看| 欧美在线免费视屏| 天堂影院一区二区| 这里只有精品电影| 九九热在线视频观看这里只有精品| 日韩一区二区三免费高清| 日本vs亚洲vs韩国一区三区二区| 日韩精品一区国产麻豆| 国产精品一级片在线观看| 中文字幕一区二区在线播放| av不卡在线播放| 夜夜嗨av一区二区三区网页| 欧美日韩国产乱码电影| 久久99久久99精品免视看婷婷 | 捆绑调教一区二区三区| 久久影院午夜论| 一本大道久久a久久综合| 日韩精品福利网| 国产精品你懂的| 欧美高清激情brazzers| 国产精品夜夜爽| 亚洲一级二级三级| 久久久国产综合精品女国产盗摄| 日韩精品一区二区三区中文不卡| 国产精品456| 一区二区三区中文在线| 精品福利一二区| 欧洲视频一区二区| 国产一区不卡精品| 亚洲一线二线三线视频| 久久这里只有精品视频网| 91精品1区2区| 国模套图日韩精品一区二区| 亚洲精选视频在线| 久久夜色精品国产欧美乱极品| 91在线小视频| 国产精品中文有码| 首页国产欧美久久| 亚洲欧美激情在线| 国产色91在线| 日韩三级精品电影久久久| 99国产精品久久久久久久久久久 | 精品一区二区三区久久久| 日韩理论电影院| 久久久久国产精品麻豆ai换脸 | 国产精品福利一区| 精品三级在线看| 欧美高清性hdvideosex| 99re这里都是精品| 国产一区二区日韩精品| 午夜电影网亚洲视频| 亚洲美女视频在线观看| 日本一区二区视频在线| 欧美成人精精品一区二区频| ●精品国产综合乱码久久久久| 欧美一区2区视频在线观看| 在线视频你懂得一区| 播五月开心婷婷综合| 国产一二精品视频| 麻豆久久久久久| 亚洲成人动漫av| 一区二区三区欧美在线观看| 中文字幕一区二区三区视频| 国产精品色在线| 国产精品久久久久久久久免费丝袜| 久久久久久久久久久久久久久99| 日韩午夜av一区| 欧美一区二区三区小说| 91精品国产一区二区三区| 欧美日韩成人激情| 欧美精品成人一区二区三区四区| 日本韩国一区二区| 欧洲一区在线观看| 欧美日韩小视频| 在线播放一区二区三区| 欧美妇女性影城| 欧美一级精品大片| 欧美精品一区二区三区一线天视频| 欧美一区二区私人影院日本| 91麻豆精品国产自产在线| 欧美一区二区视频在线观看2022| 欧美一级生活片| 精品剧情v国产在线观看在线| 日韩免费电影一区| 欧美精品一区二区三区蜜桃视频| 日韩免费高清视频| 国产欧美一区二区三区鸳鸯浴| 中文字幕av资源一区| 中文成人综合网| 亚洲男人天堂av| 午夜影院久久久| 精品亚洲国内自在自线福利| 国产成人精品一区二区三区四区| 成人免费视频播放| 欧美丝袜自拍制服另类| 日韩欧美国产1| 国产色产综合产在线视频| 亚洲乱码国产乱码精品精小说 | 7799精品视频| 欧美精品一区二区三区在线播放| 国产午夜精品一区二区三区视频 | 韩国午夜理伦三级不卡影院| 国产91色综合久久免费分享| www.亚洲精品| 欧美亚洲高清一区二区三区不卡| 欧美一区二区在线看| 国产精品网站一区| 丝袜亚洲另类丝袜在线| 国产成人午夜精品5599 | 成人av在线资源网站| 在线视频欧美精品| www国产精品av| 亚洲女爱视频在线| 日韩精品亚洲专区| 成人一区二区三区| 在线不卡的av| 中文字幕在线不卡一区二区三区| 一区二区国产视频| 精品在线亚洲视频| 欧美色图一区二区三区| 久久久久久久久一| 日韩电影免费一区| 色综合中文字幕国产 | 五月婷婷久久综合| 成人免费观看男女羞羞视频| 在线成人av网站| 中文字幕一区av| 狠狠色丁香九九婷婷综合五月| 日本福利一区二区| 国产欧美视频一区二区| 午夜欧美大尺度福利影院在线看| 成人在线视频一区二区| 欧美一区2区视频在线观看| 一区二区三区四区视频精品免费 | 亚洲精选视频在线| 岛国精品在线观看| 欧美va亚洲va在线观看蝴蝶网| 一区二区欧美国产| aaa国产一区| 国产日产欧美一区二区三区| 日韩电影一区二区三区| 在线看国产一区| 亚洲欧美另类小说视频| 成人激情免费视频| 国产欧美一区二区精品性色| 韩国欧美国产1区| 日韩欧美国产精品一区| 日韩av网站免费在线| 欧美性一级生活| 亚洲一线二线三线视频| 色香蕉久久蜜桃| 亚洲精品视频在线观看免费| 成人av动漫在线| 中文成人综合网| www.日本不卡| 亚洲色欲色欲www| 91视频xxxx| 亚洲欧美在线另类| 99久久99久久精品免费看蜜桃| 欧美激情一二三区| 懂色中文一区二区在线播放| 国产日韩欧美综合在线| 国产精品一区二区无线| 国产亚洲精品7777| 国产成人精品亚洲午夜麻豆| 日本一区二区三区国色天香| 丁香婷婷综合网| 亚洲欧美在线视频| 91福利视频久久久久| 亚洲一区二区三区中文字幕 | 亚洲欧洲av一区二区三区久久| 色综合久久六月婷婷中文字幕| ...xxx性欧美| 色婷婷精品大在线视频| 亚洲国产一区在线观看| 精品污污网站免费看| 日日夜夜免费精品| 欧美成人一区二区三区| 国产精品1区2区| 中文字幕亚洲在| 欧美特级限制片免费在线观看| 日韩精品欧美精品| 久久伊99综合婷婷久久伊| 成人高清视频免费观看| 亚洲精选视频免费看| 欧美一区二区久久| 国产成人亚洲综合色影视| 亚洲色图制服丝袜| 91麻豆精品91久久久久久清纯| 国产一区在线观看麻豆| 亚洲少妇30p| 欧美一级艳片视频免费观看| 国产成人精品午夜视频免费| 一区二区三区在线视频免费观看| 5858s免费视频成人| 国产成人av电影| 午夜影院在线观看欧美| 国产蜜臀97一区二区三区|