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

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

?? deb1d1~1.cpp

?? 游戲的聲音圖像演示程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
Destroy_BOB(&skelaton);
Destroy_BOB(&bat);

// 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 Skelaton_AI(void)
{
// this function controls the ai of the skelaton and the pattern
// processing


// these are local defines to help compute the direction to move the
// skelaton if it needs to hunt down bat, note they are all in power
// of 2 order, hence, they are mutually exclusive

#define WEST_BIT     1
#define EAST_BIT     2
#define NORTH_BIT    4 
#define SOUTH_BIT    8 

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

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

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

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

            } break;

        case OPC_NE:
            {
            // set direction to northeast
            Set_Vel_BOB(&skelaton,3,-3);
  
            // set animation to northeast
            Set_Animation_BOB(&skelaton,opcode);
            
            // set counter to instuction operand
            skelaton_counter = operand;

            } break;

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

            } break;            

        case OPC_NW:
            {
            // set direction to northwest
            Set_Vel_BOB(&skelaton,-3,-3);
  
            // set animation to northwest
            Set_Animation_BOB(&skelaton,opcode);
            
            // set counter to instuction operand
            skelaton_counter = operand;

            } break;            

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

        case OPC_SW:
            {
            // set direction to southwest
            Set_Vel_BOB(&skelaton,-3,3);
  
            // set animation to southwest
            Set_Animation_BOB(&skelaton,opcode);
            
            // set counter to instuction operand
            skelaton_counter = operand;

            } break;            

        case OPC_S: 
            {
            // set direction to south
            Set_Vel_BOB(&skelaton,0,3);
  
            // set animation to south
            Set_Animation_BOB(&skelaton,opcode);
            
            // set counter to instuction operand
            skelaton_counter = operand;

            } break;            

        case OPC_SE:
            {
            // set direction to southeast
            Set_Vel_BOB(&skelaton,3,3);
  
            // set animation to southeast
            Set_Animation_BOB(&skelaton,opcode);
            
            // set counter to instuction operand
            skelaton_counter = operand;

            } break;            

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

            } break;

        case OPC_RAND:
            {
            // set counter to instuction operand
            skelaton_counter = 0;

            } break;

        case OPC_TEST_DIST:
             {
             // test distance between bat and skelaton
             // if bat is too far, then move toward bat

             int dx = (bat.x - skelaton.x);
             int dy = (bat.y - skelaton.y);

             // test distance against minimum lonelyness
             if (sqrt((dx*dx) + (dy*dy)) > MIN_LONELYNESS)
                {
                // the skelaton needs to be pointed toward the bat (player)
                // this is a bit hard because we need to point the skelaton
                // in 1 of 8 directions, instead of just giving him a velocity
                // to solve the problem well break it up into a dx and a dy and then
                // use a look up table to set everything up right
   
                DSound_Play(laugh_sound_id);

                int direction = 0; // the bit encoded direction

                // first east-west
                if (bat.x > skelaton.x)
                   direction|=EAST_BIT;
                else
                if (bat.x < skelaton.x)
                   direction|=WEST_BIT;
                
                // now north-south
                if (bat.y > skelaton.y)
                   direction|=SOUTH_BIT;
                else
                if (bat.y < skelaton.y)
                   direction|=NORTH_BIT;
          
                // test final direction, note this could be compressed into
                // another look up table, but this is simpler 
                switch(direction)
                        {
                        case WEST_BIT:
                            {
                            // set motion
                            Set_Vel_BOB(&skelaton,-3,0);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_W);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;

                            } break;

                        case EAST_BIT:     
                             {
                            // set motion
                            Set_Vel_BOB(&skelaton,3,0);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_E);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;

                             } break;

                        case NORTH_BIT:     
                            {
                            // set motion
                            Set_Vel_BOB(&skelaton,0,-3);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_N);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;

                            } break;

                        case SOUTH_BIT:     
                            {
                            // set motion
                            Set_Vel_BOB(&skelaton,0,3);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_S);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;
                            } break;

                        case (NORTH_BIT | WEST_BIT):
                            {
                            // set motion
                            Set_Vel_BOB(&skelaton,-3,-3);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_NW);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;
                            } break;

                        case (NORTH_BIT | EAST_BIT):
                            {
                            // set motion
                            Set_Vel_BOB(&skelaton,3,-3);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_NE);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;
                            } break;

                        case (SOUTH_BIT | WEST_BIT):
                            {
                            // set motion
                            Set_Vel_BOB(&skelaton,-3,3);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_SW);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;
                            } break;

                        case (SOUTH_BIT | EAST_BIT):
                            {
                            // set motion
                            Set_Vel_BOB(&skelaton,3,3);
  
                            // set animation 
                            Set_Animation_BOB(&skelaton,OPC_SE);
            
                            // set counter to instuction operand
                            skelaton_counter = operand;
                            } break;

                        default: break;

                        } // end switch 
               
                } // end if

             } break;

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

            // reset counter
            skelaton_counter = 0;

            } break;
        
        default: break;

        } // end switch

    } // end if


// draw stats
sprintf(buffer,"Pattern #%d",skelaton_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 ", skelaton_ip);
Draw_Text_GDI(buffer,10, 432,RGB(0,255,0), lpddsback);

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

} // end skelaton_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 skelaton
Skelaton_AI();

// animate the bat
Animate_BOB(&bat);

// the animate the skelaton unless its stopped
if (opcode!=OPC_STOP)
   Animate_BOB(&skelaton);

// move skelaton
Move_BOB(&skelaton);

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

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

// let player move the bat
// allow player to move
if (keyboard_state[DIK_RIGHT])
   bat.x+=4;
else
if (keyboard_state[DIK_LEFT])
   bat.x-=4;

if (keyboard_state[DIK_UP])
   bat.y-=4;
else
if (keyboard_state[DIK_DOWN])
   bat.y+=4;


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

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

// draw the skelaton
Draw_BOB(&skelaton, lpddsback);

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

// draw title
Draw_Text_GDI("(16-Bit Version) Skelaton Pattern Demo With Tracking",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一区二区三区高| 激情深爱一区二区| 国产精品成人免费| 国产精品视频观看| 久久久久久99精品| 国产精品你懂的在线欣赏| 国产午夜一区二区三区| 国产精品久久久久久久久晋中| 精品国产一区二区三区av性色| 日韩欧美一级二级三级久久久| 91精品国产乱| 亚洲国产精品av| 有码一区二区三区| 日韩国产在线观看一区| 韩国午夜理伦三级不卡影院| 波多野结衣在线aⅴ中文字幕不卡| 99久久99久久精品免费看蜜桃| 色综合久久综合网| 91麻豆精品久久久久蜜臀| 国产精品三级视频| 五月天丁香久久| 高清不卡在线观看| 日韩视频在线永久播放| 国产精品久久久久久久久免费樱桃 | 成人app网站| 舔着乳尖日韩一区| 久草中文综合在线| 在线观看亚洲一区| 国产网红主播福利一区二区| 亚洲欧美国产毛片在线| 黄页视频在线91| 日韩午夜精品视频| 亚洲高清视频在线| 91麻豆精东视频| 国产精品美女久久久久久久久| 麻豆91小视频| 欧美丰满一区二区免费视频| 亚洲欧美国产高清| 91啪亚洲精品| 亚洲电影一级片| 欧美日韩一区在线| 首页综合国产亚洲丝袜| 欧美日韩亚洲综合在线| 亚洲久本草在线中文字幕| 成人av在线播放网站| 中文字幕一区二区三区四区| 成人一区在线观看| 国产精品久久久久影院| 国产精品一区二区在线看| 精品国产123| 东方aⅴ免费观看久久av| 亚洲欧洲日韩一区二区三区| 99久久免费视频.com| 一区二区三区波多野结衣在线观看| 91小视频免费观看| 丝袜美腿一区二区三区| 2021中文字幕一区亚洲| www.视频一区| 蜜桃久久久久久| 亚洲天堂免费在线观看视频| 欧美三级资源在线| 国产制服丝袜一区| 亚洲综合色区另类av| 精品国产人成亚洲区| 色婷婷久久综合| 国产一区二区三区在线看麻豆| 中文字幕中文乱码欧美一区二区 | 久久九九久久九九| 欧美在线播放高清精品| 国产成人精品影视| 日韩国产欧美一区二区三区| 国产精品国产自产拍在线| 91精品国产一区二区| 色婷婷综合久色| 成人永久免费视频| 韩国一区二区视频| 麻豆精品国产91久久久久久| 一区二区在线观看视频| 国产精品久久久久7777按摩| 久久中文娱乐网| av高清久久久| 丝袜亚洲精品中文字幕一区| 亚洲少妇最新在线视频| 国产午夜亚洲精品不卡| 久久亚洲私人国产精品va媚药| 欧美欧美午夜aⅴ在线观看| 欧美日韩一区在线观看| 麻豆精品久久精品色综合| 亚洲国产色一区| 亚洲一区二区av在线| 亚洲综合无码一区二区| 亚洲第一成年网| 欧美96一区二区免费视频| 蜜臀va亚洲va欧美va天堂| 美腿丝袜亚洲三区| 成人激情黄色小说| 色婷婷综合久久久中文字幕| 欧美日韩中文精品| 欧美成人艳星乳罩| 国产女主播一区| 欧美国产乱子伦| 亚洲成人激情自拍| 精品一区二区三区久久| 99视频在线精品| 在线播放视频一区| 国产欧美精品一区二区色综合 | 久草精品在线观看| 色综合天天综合网天天狠天天| 欧美视频在线一区二区三区| 欧美日韩国产不卡| 中文字幕制服丝袜一区二区三区 | 高清免费成人av| 欧美日本乱大交xxxxx| 国产视频视频一区| 亚洲国产综合91精品麻豆| 国产成人免费在线视频| 欧美日韩国产经典色站一区二区三区| 欧美唯美清纯偷拍| 国产精品毛片高清在线完整版 | 色欧美日韩亚洲| 国产日韩一级二级三级| 日韩电影在线免费看| 在线看国产一区| 一区二区三区视频在线看| 成人小视频在线观看| 久久影音资源网| 国产91精品免费| 精品精品欲导航| 久久精品亚洲麻豆av一区二区| 亚洲欧美欧美一区二区三区| 成人在线一区二区三区| 91精品国产综合久久婷婷香蕉| 椎名由奈av一区二区三区| 成人视屏免费看| 综合欧美一区二区三区| 成人福利视频网站| 亚洲欧美日韩人成在线播放| 成人涩涩免费视频| 欧美另类变人与禽xxxxx| 欧美精品黑人性xxxx| 热久久一区二区| 精品粉嫩超白一线天av| 国产99久久久久久免费看农村| 欧美国产日本视频| 在线免费观看日韩欧美| 欧美丝袜丝交足nylons图片| 亚洲国产你懂的| www久久精品| 色哟哟在线观看一区二区三区| 中文字幕亚洲视频| 欧美在线观看视频在线| 久久成人av少妇免费| 国产精品丝袜一区| 欧美天堂一区二区三区| 日本不卡免费在线视频| 久久久av毛片精品| 欧美二区三区的天堂| 成人一区二区三区在线观看| 一区二区三区四区蜜桃| 精品久久久久久久久久久院品网 | 国产成人h网站| 一区二区久久久久久| 日韩视频在线一区二区| 欧美专区日韩专区| 粗大黑人巨茎大战欧美成人| 日本在线不卡视频| 一个色综合av| 一区精品在线播放| 中文字幕精品综合| 精品理论电影在线| 日韩一区二区精品在线观看| 91玉足脚交白嫩脚丫在线播放| 韩国精品一区二区| 免费三级欧美电影| 免费在线成人网| 蜜臀av性久久久久蜜臀av麻豆| 亚洲最新在线观看| 日韩免费性生活视频播放| 九色综合狠狠综合久久| 午夜精品福利一区二区蜜股av| 亚洲欧美日韩中文字幕一区二区三区 | 91国偷自产一区二区使用方法| 国产69精品久久久久毛片| 成人一级片在线观看| 粉嫩在线一区二区三区视频| 成人开心网精品视频| 成人av网站免费观看| 欧美性猛交xxxx黑人交| 欧美欧美欧美欧美首页| 日韩欧美美女一区二区三区| 欧美成人高清电影在线| 亚洲国产精品成人久久综合一区| 国产亚洲欧美在线| 一区二区三区不卡在线观看| 亚洲激情在线激情| 免费在线观看日韩欧美| 免费在线视频一区| 成人免费观看视频| 欧美午夜一区二区| 2欧美一区二区三区在线观看视频|