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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? demo12_5_16b.cpp

?? 一本外國人寫的關于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
Load_Bitmap_File(&bitmap16bit, "BOTS24.BMP");

// create bat bob
Create_BOB(&bot,320,200,116,60,16,BOB_ATTR_MULTI_ANIM | BOB_ATTR_VISIBLE, DDSCAPS_SYSTEMMEMORY,0,16);
Set_Anim_Speed_BOB(&bot, 2);

// load the bot in 
for (index=0; index < 16; index++)
    Load_Frame_BOB16(&bot, &bitmap16bit, index, index%2, index/2, BITMAP_EXTRACT_MODE_CELL);

// unload bot
Unload_Bitmap_File(&bitmap16bit);

// create animations for bot
for (index=0; index<8; index++)
    {
    // generate the animation on the fly
    bot_anim[0] = index*2;
    bot_anim[1] = bot_anim[0]+1;

    // load the generated animation
    Load_Animation_BOB(&bot, index, 2, bot_anim);
    } // end for index

// set the animation to right direction
Set_Animation_BOB(&bot,0);

// initialize directinput
DInput_Init();

// acquire the keyboard only
DInput_Init_Keyboard();

// initilize DirectSound
DSound_Init();

// load background sounds
engines_id = DSound_Load_WAV("ENGINES.WAV");

// start the sounds
DSound_Play(engines_id, DSBPLAY_LOOPING);

// hide the mouse
if (!WINDOWED_APP)
   ShowCursor(FALSE);

// seed random number generate
srand(Start_Clock());

// return success
return(1);

} // end Game_Init

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

int Game_Shutdown(void *parms)
{
// this function is where you shutdown your game and
// release all resources that you allocated

// shut everything down

// kill all the bobs
Destroy_BOB(&bot);

// shutdown directdraw last
DDraw_Shutdown();

// now directsound
DSound_Stop_All_Sounds();
DSound_Shutdown();

// shut down directinput
DInput_Shutdown();

// return success
return(1);
} // end Game_Shutdown

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

void Bot_AI(void)
{
// this function controls the ai of the bot and the pattern
// processing

static int opcode,  // current pattern opcode
           operand; // current operand 

// test if it's time to process a new instruction
if (curr_pattern==NULL)
   {
   // select a random pattern in pattern bank
   bot_pattern_index = rand()%NUM_PATTERNS;
   curr_pattern = patterns[bot_pattern_index];
   
   // now reset instuction pointer
   bot_ip = 0;

   // reset counter
   bot_counter = 0;
 
   } // end if

// process next instruction if it's time
if (--bot_counter <= 0)
    {
    // get next instruction
    opcode  = curr_pattern[bot_ip++];
    operand = curr_pattern[bot_ip++];

    // test what the opcode is
    switch(opcode)
        {
        case OPC_E:
            {
            // set direction to east
            Set_Vel_BOB(&bot,6,0);
  
            // set animation to east
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;

        case OPC_NE:
            {
            // set direction to northeast
            Set_Vel_BOB(&bot,6,-6);
  
            // set animation to northeast
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;

        case OPC_N: 
            {
            // set direction to north
            Set_Vel_BOB(&bot,0,-6);
  
            // set animation to north
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;            

        case OPC_NW:
            {
            // set direction to northwest
            Set_Vel_BOB(&bot,-6,-6);
  
            // set animation to northwest
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;            

        case OPC_W: 
            {
            // set direction to west
            Set_Vel_BOB(&bot,-6,0);
  
            // set animation to west
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;
			 
            } break;            

        case OPC_SW:
            {
            // set direction to southwest
            Set_Vel_BOB(&bot,-6,6);
  
            // set animation to southwest
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;            

        case OPC_S: 
            {
            // set direction to south
            Set_Vel_BOB(&bot,0,6);
  
            // set animation to south
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;            

        case OPC_SE:
            {
            // set direction to southeast
            Set_Vel_BOB(&bot,6,6);
  
            // set animation to southeast
            Set_Animation_BOB(&bot,opcode);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;            

        case OPC_STOP: 
            {
            // stop motion
            Set_Vel_BOB(&bot,0,0);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;

        case OPC_RAND:
            {
            // set direction randomly
            Set_Vel_BOB(&bot,-4+rand()%9,-4+rand()%9);
  
            // set animation to south
            Set_Animation_BOB(&bot,OPC_S);
            
            // set counter to instuction operand
            bot_counter = operand;

            } break;

        case OPC_END: 
            {
            // stop motion
            Set_Vel_BOB(&bot,0,0);
            
            // select a random pattern in pattern bank
            bot_pattern_index = rand()%NUM_PATTERNS;
            curr_pattern = patterns[bot_pattern_index];
   
            // now reset instuction pointer
            bot_ip = 0;

            // reset counter
            bot_counter = 0;

            } break;
        
        default: break;

        } // end switch

    } // end if


// draw stats
sprintf(buffer,"Pattern #%d",bot_pattern_index);
Draw_Text_GDI(buffer,10, 400,RGB(0,255,0), lpddsback);

sprintf(buffer,"Opcode=%s Operand=%d",opcode_names[opcode],operand);
Draw_Text_GDI(buffer,10, 416,RGB(0,255,0), lpddsback);

sprintf(buffer,"Instruction Ptr=%d ", bot_ip);
Draw_Text_GDI(buffer,10, 432,RGB(0,255,0), lpddsback);

sprintf(buffer,"Counter=%d ", bot_counter);
Draw_Text_GDI(buffer,10, 448,RGB(0,255,0), lpddsback);

} // end Bot_AI

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

int Game_Main(void *parms)
{
// this is the workhorse of your game it will be called
// continuously in real-time this is like main() in C
// all the calls for you game go here!

int index; // looping var

// start the timing clock
Start_Clock();

// clear the drawing surface
DDraw_Fill_Surface(lpddsback, 0);

// lock back buffer and copy background into it
DDraw_Lock_Back_Surface();

// draw background
Draw_Bitmap16(&background_bmp, back_buffer, back_lpitch,0);

// unlock back surface
DDraw_Unlock_Back_Surface();

// read keyboard
DInput_Read_Keyboard();

// do the ai on bot
Bot_AI();

// the animate the bot
Animate_BOB(&bot);

// move bot
Move_BOB(&bot);

// test if bot is off screen, if so wrap around
if (bot.x >= SCREEN_WIDTH)
   bot.x = -bot.width;
else
if (bot.x < -bot.width)
   bot.x = SCREEN_WIDTH;

if (bot.y >= SCREEN_HEIGHT)
   bot.y = -bot.height;
else
if (bot.y < -bot.height)
   bot.y = SCREEN_HEIGHT;

// draw the bot
Draw_BOB16(&bot, lpddsback);

// draw title
Draw_Text_GDI("(16-Bit Version) I-ROBOT 3D - Pattern Demo",10, 10,RGB(0,255,255), lpddsback);

// flip the surfaces
DDraw_Flip();

// sync to 30ish fps
Wait_Clock(30);

// check of user is trying to exit
if (KEY_DOWN(VK_ESCAPE) || keyboard_state[DIK_ESCAPE])
    {
    PostMessage(main_window_handle, WM_DESTROY,0,0);

    // stop all sounds
    DSound_Stop_All_Sounds();

    } // end if

// return success
return(1);

} // end Game_Main

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线视频免费播放| 久久久综合视频| 日韩女优av电影在线观看| 久久免费国产精品| 亚洲成人777| 成人av免费在线| 日韩欧美黄色影院| 亚洲精品视频在线| 国产成人免费在线观看不卡| 7777女厕盗摄久久久| 亚洲女人****多毛耸耸8| 狠狠色丁香婷婷综合| 欧美精品三级在线观看| 亚洲精品成人a在线观看| 国产成人在线网站| www国产精品av| 丝袜诱惑制服诱惑色一区在线观看 | 一区二区三区中文免费| 国产99久久精品| 热久久久久久久| 欧美三级三级三级| 亚洲自拍另类综合| 一本大道久久a久久精二百| 日本一区免费视频| 国产99一区视频免费| 2021中文字幕一区亚洲| 九一久久久久久| 精品精品国产高清a毛片牛牛 | 欧美日韩电影在线| 伊人一区二区三区| 91福利在线看| 午夜天堂影视香蕉久久| 欧美在线999| 亚洲成人精品在线观看| 欧美日韩国产大片| 日韩高清不卡一区二区三区| 欧美一区二区三区的| 久久精品国内一区二区三区| 欧美大胆人体bbbb| 国产一区二区三区国产| 国产日本欧洲亚洲| 成人av网站免费观看| 一区二区三区欧美日韩| 欧美日韩国产乱码电影| 日本不卡中文字幕| 精品美女一区二区三区| 国产精品18久久久| 亚洲免费在线观看| 91精选在线观看| 国产裸体歌舞团一区二区| 国产精品美女一区二区| 欧美亚洲日本一区| 久久激五月天综合精品| 欧美国产欧美亚州国产日韩mv天天看完整| jlzzjlzz亚洲女人18| 亚洲国产sm捆绑调教视频 | 久热成人在线视频| 日本一区二区三区四区在线视频| 丁香六月久久综合狠狠色| 一区二区三区四区不卡在线 | 国产精品成人一区二区艾草 | 国产人妖乱国产精品人妖| av不卡在线播放| 亚洲18色成人| 国产午夜亚洲精品羞羞网站| 一本色道综合亚洲| 国产真实乱对白精彩久久| 国产精品成人一区二区三区夜夜夜| 欧美日韩中文另类| 国产丶欧美丶日本不卡视频| 一级做a爱片久久| 久久综合九色综合欧美亚洲| 91福利国产精品| 欧美乱熟臀69xxxxxx| 国产成人小视频| 日韩av网站在线观看| 中文字幕欧美一| 欧美xxxxx牲另类人与| 欧美亚洲图片小说| 成人激情电影免费在线观看| 蜜臀精品久久久久久蜜臀| 亚洲色图另类专区| 国产天堂亚洲国产碰碰| 欧美一区二视频| 91国偷自产一区二区使用方法| 国内精品久久久久影院色| 亚洲国产aⅴ成人精品无吗| 国产精品久久毛片a| 久久综合狠狠综合久久激情| 欧美在线免费播放| 99免费精品视频| 国产精品456露脸| 蜜臀国产一区二区三区在线播放| 亚洲韩国精品一区| 亚洲精品视频在线| 自拍视频在线观看一区二区| 久久精品人人做| 精品日本一线二线三线不卡| 在线播放中文一区| 精品1区2区3区| 91麻豆精品秘密| 91丨porny丨户外露出| 丁香五精品蜜臀久久久久99网站| 蜜臀av性久久久久蜜臀av麻豆| 亚洲高清免费一级二级三级| 一区二区三区四区不卡视频 | 久久精品国产精品亚洲精品| 亚洲成人av在线电影| 亚洲成人在线免费| 午夜精品视频一区| 午夜久久久影院| 肉色丝袜一区二区| 五月开心婷婷久久| 日韩主播视频在线| 日韩精品电影一区亚洲| 午夜精品久久久久| 男男gaygay亚洲| 激情五月婷婷综合网| 国产剧情一区在线| 粗大黑人巨茎大战欧美成人| 成+人+亚洲+综合天堂| 成人激情开心网| 色综合久久久久| 欧美日韩一二三区| 日韩视频中午一区| 久久亚洲一级片| 国产精品国产三级国产a| 中文字幕一区二区5566日韩| 亚洲美女偷拍久久| 亚洲超碰精品一区二区| 另类的小说在线视频另类成人小视频在线| 久久精品国产网站| 高清不卡一区二区| 91福利在线导航| 日韩精品中文字幕一区二区三区| 日韩欧美黄色影院| 九九国产精品视频| av在线播放成人| 欧美日韩不卡一区二区| 精品99999| 亚洲天堂福利av| 亚洲成人综合视频| 国产乱子伦视频一区二区三区| 成年人国产精品| 欧美日韩久久久一区| 久久免费视频色| 亚洲一区在线播放| 国产最新精品免费| 色婷婷狠狠综合| 日韩欧美在线1卡| 一区在线播放视频| 麻豆国产欧美日韩综合精品二区| 粉嫩13p一区二区三区| 欧美日韩国产大片| 国产精品福利一区二区| 日本午夜一本久久久综合| av电影在线观看一区| 日韩午夜av一区| 一区二区三区蜜桃网| 国产裸体歌舞团一区二区| 欧美日韩精品一区视频| 国产精品成人免费精品自在线观看| 亚洲国产欧美日韩另类综合| 丁香亚洲综合激情啪啪综合| 欧美一区二区三区精品| 亚洲美女免费在线| 粉嫩av一区二区三区| 日韩久久久精品| 天天色天天爱天天射综合| 成a人片国产精品| 久久久久久久久久久久久久久99 | 国产91精品免费| 日韩一级黄色大片| 亚洲成年人影院| 91年精品国产| 中文字幕一区二区三区视频| 精品一区精品二区高清| 日韩一区二区三区三四区视频在线观看| 中文字幕一区视频| 国产一区二区美女诱惑| 日韩亚洲欧美在线观看| 亚洲成人中文在线| 欧美性一二三区| 亚洲欧美日韩国产一区二区三区| 从欧美一区二区三区| 久久奇米777| 狠狠色综合播放一区二区| 日韩免费一区二区三区在线播放| 偷拍一区二区三区| 欧美性一二三区| 亚洲午夜久久久久久久久电影网| 99re这里只有精品6| 国产精品传媒视频| 99re6这里只有精品视频在线观看| 国产人成亚洲第一网站在线播放| 激情综合一区二区三区| 日韩欧美国产三级| 精品一区二区av| 久久美女艺术照精彩视频福利播放 | 成人午夜免费视频|