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

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

?? demo12_3.cpp

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


void Init_Plasma(void)
{
// this function initializes and loads all the plasma 
// weapon pulses

// the plasma animations
static int plasma_anim_player[] = {0,1,2,3,4,5,6,7},
   		   plasma_anim_enemy[]  = {8,9,10,11,12,13,14,15};

// load the plasma imagery 
Load_Bitmap_File(&bitmap8bit, "OUTART/ENERGY8.BMP");

// create the first bob
Create_BOB(&plasma[0],0,0,8,8,16,
            BOB_ATTR_VISIBLE | BOB_ATTR_MULTI_ANIM,
            DDSCAPS_SYSTEMMEMORY);

// load animation frames
for (int frame=0; frame < 16; frame++)
     Load_Frame_BOB(&plasma[0],&bitmap8bit,frame,frame%8,frame/8,BITMAP_EXTRACT_MODE_CELL);  

// set animation rate
Set_Anim_Speed_BOB(&plasma[0],1);

// load animations
Load_Animation_BOB(&plasma[0], PLASMA_ANIM_PLAYER, 8, plasma_anim_player);
Load_Animation_BOB(&plasma[0], PLASMA_ANIM_ENEMY, 8, plasma_anim_enemy);

// set state to off
plasma[0].state = PLASMA_STATE_OFF;

for (int pulse=1; pulse < MAX_PLASMA; pulse++)
    {
    memcpy(&plasma[pulse], &plasma[0], sizeof(BOB));
    } // end for pulse

// unload data infile
Unload_Bitmap_File(&bitmap8bit);

} // end Init_Plasma

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

void Reset_Plasma(void)
{
// this function resets all the plasma pulses
for (int pulse = 0; pulse < MAX_PLASMA; pulse++)
    {
    plasma[pulse].state = PLASMA_STATE_OFF;
    } // end for pulse

} // end Reset_Plasma

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

void Delete_Plasma(void)
{
// this function simply deletes all memory and surfaces
// related to the plasma pulses

for (int index=0; index < MAX_PLASMA; index++)
    Destroy_BOB(&plasma[index]);

} // end Delete_Plasma

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

void Move_Plasma(void)
{
// this function moves all the plasma pulses and checks for
// collision with the rocks

for (int index=0; index < MAX_PLASMA; index++)
    {
    // test if plasma pulse is in flight
    if (plasma[index].state == PLASMA_STATE_ON)
        {
        // move the pulse 
        plasma[index].varsI[INDEX_WORLD_X]+=plasma[index].xv;
        plasma[index].varsI[INDEX_WORLD_Y]+=plasma[index].yv;
          
        // test for boundaries
        if ( (++plasma[index].counter_1 > PLASMA_RANGE_1)              || 
                (plasma[index].varsI[INDEX_WORLD_X] > UNIVERSE_MAX_X)  || 
                (plasma[index].varsI[INDEX_WORLD_X] < UNIVERSE_MIN_X ) ||
	            (plasma[index].varsI[INDEX_WORLD_Y] > UNIVERSE_MAX_Y)  || 
                (plasma[index].varsI[INDEX_WORLD_Y] < UNIVERSE_MIN_Y ) )
            {
            // kill the pulse
            plasma[index].state = PLASMA_STATE_OFF;
            plasma[index].counter_1 = 0;

            // move to next pulse
            continue;
            } // end if


// test for mines

 // test for mines
 for (int mine=0; mine < MAX_MINES; mine++)
     {
     if (mines[mine].state==MINE_STATE_ALIVE && 
         plasma[index].anim_state == PLASMA_ANIM_PLAYER  )
         {
         // test for collision 
         if (Collision_Test(plasma[index].varsI[INDEX_WORLD_X]-(plasma[index].width*.5), 
                            plasma[index].varsI[INDEX_WORLD_Y]-(plasma[index].height*.5), 
                            plasma[index].width, plasma[index].height,
                            mines[mine].varsI[INDEX_WORLD_X]-(mines[mine].width*.5), 
			     		    mines[mine].varsI[INDEX_WORLD_Y]-(mines[mine].height*.5),
                            mines[mine].width, mines[mine].height))
             {
             // kill pulse
             plasma[index].state     = PLASMA_STATE_OFF;
             plasma[index].counter_1 = 0;

             // do damage to mine
             mines[mine].varsI[INDEX_MINE_DAMAGE]+=(1+rand()%3);

             // increase the damage on the mine and test for death
             if (mines[mine].varsI[INDEX_MINE_DAMAGE] > MAX_MINE_DAMAGE)
                {
                // kill the ship    
                mines[mine].state=MINE_STATE_DEAD;

                // start a new mine
                Start_Mine();

                // add to players score
                player_score+=250;

                } // end if

             int width = 30+rand()%40;

             // start a burst
             Start_Burst(plasma[index].varsI[INDEX_WORLD_X], 
                         plasma[index].varsI[INDEX_WORLD_Y], 
                         width, (width*.5) + (width*.25),
                         int(mines[mine].xv)*.5, int(mines[mine].yv)*.5);   
             break; 
             } // end if
     
     } // end if alive

     } // end for mines


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

// test for stations
 for (int station=0; station < MAX_STATIONS; station++)
     {
     if (stations[station].state == STATION_STATE_ALIVE && 
         plasma[index].anim_state == PLASMA_ANIM_PLAYER  )
         {
         // test for collision 
         if ( //stations[station].anim_state == STATION_SHIELDS_ANIM_OFF &&
             Collision_Test(plasma[index].varsI[INDEX_WORLD_X]-(plasma[index].width*.5), 
                            plasma[index].varsI[INDEX_WORLD_Y]-(plasma[index].height*.5), 
                            plasma[index].width, plasma[index].height,
                            stations[station].varsI[INDEX_WORLD_X]-(stations[station].width*.5), 
			     		    stations[station].varsI[INDEX_WORLD_Y]-(stations[station].height*.5),
                            stations[station].width, stations[station].height))
             {
             // kill pulse
             plasma[index].state = PLASMA_STATE_OFF;
             plasma[index].counter_1 = 0;

             // do damage to station
             stations[station].varsI[INDEX_STATION_DAMAGE]+=(1+rand()%3);

             // increase the damage on the station and test for death
             if (stations[station].varsI[INDEX_STATION_DAMAGE] > MAX_STATION_DAMAGE)
                {
                // kill the station
                stations[station].state=STATION_STATE_DEAD;

                // add to players score
                player_score+=10000;

                // has played won
                if (++num_stations_destroyed >= NUM_ACTIVE_STATIONS)
                   {
                   win_counter = 0;
                   player_won = 1;   
                   } // end if

                // make big sound
                DSound_Play(station_blow_id);

                } // end if

             // start a burst
             Start_Burst(plasma[index].varsI[INDEX_WORLD_X], 
                         plasma[index].varsI[INDEX_WORLD_Y], 
                         40+rand()%20,30+rand()%16,
                         int(stations[station].xv)*.5, int(stations[station].yv)*.5);   
             break; 
             } // end if
     
     } // end if alive

     } // end for stations


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


    // test for collision with player
    if (plasma[index].anim_state == PLASMA_ANIM_ENEMY && player_state == PLAYER_STATE_ALIVE &&
        Collision_Test(plasma[index].varsI[INDEX_WORLD_X]-(plasma[index].width*.5), 
		               plasma[index].varsI[INDEX_WORLD_Y]-(plasma[index].height*.5), 
                       plasma[index].width, plasma[index].height,
                       player_x-(wraith.width*.5), 
                       player_y-(wraith.height*.5),
                       wraith.width, wraith.height))
        {

        Start_Burst(plasma[index].varsI[INDEX_WORLD_X], 
                    plasma[index].varsI[INDEX_WORLD_Y], 
                    40+rand()%20,30+rand()%16,
                    int(player_xv)*.5, int(player_yv)*.5);

        // update players damage
        player_damage+=2;

    
        // engage shields
        player_shield_count=3;

        // kill the pulse
        plasma[index].state = PLASMA_STATE_OFF;
        plasma[index].counter_1 = 0;

        // plasma is dead
        continue;
        } // end if

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


        // test for collision with rocks
        for (int rock=0; rock < MAX_ROCKS; rock++)
            {
            if (rocks[rock].state==ROCK_STATE_ON)
                {
                // test for collision 
                if (Collision_Test(plasma[index].varsI[INDEX_WORLD_X]-(plasma[index].width*.5), 
					               plasma[index].varsI[INDEX_WORLD_Y]-(plasma[index].height*.5), 
                                   plasma[index].width, plasma[index].height,
                                   rocks[rock].varsI[INDEX_WORLD_X]-(rocks[rock].width*.5), 
								   rocks[rock].varsI[INDEX_WORLD_Y]-(rocks[rock].height*.5),
                                   rocks[rock].width, rocks[rock].height))
                    {
                    // kill pulse
                    plasma[index].state = PLASMA_STATE_OFF;
                    plasma[index].counter_1 = 0;
  
                    switch(rocks[rock].varsI[0])
                          {
                          case ROCK_LARGE:
                              {
                              // start explosion
                              Start_Burst(plasma[index].varsI[INDEX_WORLD_X], plasma[index].varsI[INDEX_WORLD_Y], 
                                          68+rand()%12,54+rand()%10,
                                          rocks[rock].xv*.5, rocks[rock].yv*.5);
                                        
                              } break;

                          case ROCK_MEDIUM:
                              {
                              // start explosion
                              Start_Burst(plasma[index].varsI[INDEX_WORLD_X], plasma[index].varsI[INDEX_WORLD_Y], 
                                          52+rand()%10,44+rand()%8,
                                          rocks[rock].xv*.5, rocks[rock].yv*.5);

                              } break;

                          case ROCK_SMALL:
                              {

                              // start explosion
                              Start_Burst(plasma[index].varsI[INDEX_WORLD_X], plasma[index].varsI[INDEX_WORLD_Y], 
                                          34-4+rand()%8,30-3+rand()%6,
                                          rocks[rock].xv*.5, rocks[rock].yv*.5);

                              } break;
                          
                          } // end switch

                    // update score
                    player_score+=rocks[rock].varsI[2];

                    // test strength of rock, cause damage
                    rocks[rock].varsI[2]-=50;

                    // split test
                    if (rocks[rock].varsI[2] > 0 && rocks[rock].varsI[2] < 50)
                        {
                        // test the size of rock
                        switch(rocks[rock].varsI[0])
                        {
                        case ROCK_LARGE:
                            {
                            // split into two medium
                            Start_Rock(rocks[rock].varsI[INDEX_WORLD_X]+rand()%16,rocks[rock].varsI[INDEX_WORLD_Y]+rand()%16,
                                       ROCK_MEDIUM,
                                       rocks[rock].xv-2+rand()%4,rocks[rock].yv-2+rand()%4);
                    
                            Start_Rock(rocks[rock].varsI[INDEX_WORLD_X]+rand()%16,rocks[rock].varsI[INDEX_WORLD_Y]+rand()%16,
                                       ROCK_MEDIUM,
                                       rocks[rock].xv-2+rand()%4,rocks[rock].yv-2+rand()%4);
                            
                           // throw in a small?
                           if ((rand()%3)==1)
                            Start_Rock(rocks[rock].varsI[INDEX_WORLD_X]+rand()%16,rocks[rock].varsI[INDEX_WORLD_Y]+rand()%16,
                                       ROCK_SMALL,
                                       rocks[rock].xv-2+rand()%4,rocks[rock].yv-2+rand()%4);

                            // kill the original
                            rocks[rock].state = ROCK_STATE_OFF;     
            
                            } break;

                        case ROCK_MEDIUM:
                            {
                            // split into 1 - 3 small
                            int num_rocks = 1+rand()%3;

                            for (; num_rocks >=1; num_rocks--)
                                {
                                Start_Rock(rocks[rock].varsI[INDEX_WORLD_X]+rand()%8,rocks[rock].varsI[INDEX_WORLD_Y]+rand()%8,
                                           ROCK_SMALL,
                                           rocks[rock].xv-2+rand()%4,rocks[rock].yv-2+rand()%4);

                                } // end for num_rocks
                 
                            // kill the original
                            rocks[rock].state = ROCK_STATE_OFF;

                            } break;

                        case ROCK_SMALL:
                            {
                            // just kill it
                            rocks[rock].state = ROCK_STATE_OFF;

                            } break;
 
                        default:break;

        
                        } // end switch

                        } // end if split
                    else
                    if (rocks[rock].varsI[2] <= 0)
                        {
                        // kill rock
                        rocks[rock].state = ROCK_STATE_OFF;
                        } // end else

                    // break out of loop
                    break;

                   } // end if collision

                } // end if rock alive

            } // end for rock

      } // end if

    } // end for index

} // end Move_Plasma

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

void Draw_Plasma(void)
{
// this function draws all the plasma pulses

for (int index=0; index<MAX_PLASMA; index++)
    {
    // test if plasma pulse is in flight
    if (plasma[index].state == PLASMA_STATE_ON)
        {
        // transform to screen coords
        plasma[index].x = plasma[index].varsI[INDEX_WORLD_X] - (plasma[index].width >> 1) - player_x + (SCREEN_WIDTH/2);
        plasma[index].y = plasma[index].varsI[INDEX_WORLD_Y] - (plasma[index].height >> 1) - player_y + (SCREEN_HEIGHT/2);

        // draw the pulse
        Draw_BOB(&plasma[index],lpddsback);
         
        // animate the pulse
        Animate_BOB(&plasma[index]);

        } // end if

    } // end for index

} // end Draw_Plasma

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

void Fire_Plasma(int x,int y, int xv, int yv, int source=PLASMA_ANIM_PLAYER)
{
// this function fires a plasma pulse at the given starting
// position and velocity, of course, one must be free for 
// this to work

// scan for a pulse that is available
for (int index=0; index < MAX_PLASMA; index++)
    {
    // is this one available
      // test if plasma pulse is in flight
    if (plasma[index].state == PLASMA_STATE_OFF)
       {
       // start this one up, note the use of world coords
       plasma[index].varsI[INDEX_WORLD_X] = x-(plasma[0].width*.5);
       plasma[index].varsI[INDEX_WORLD_Y] = y-(plasma[0].height*.5);
       
       plasma[index].xv = xv;
	   plasma[index].yv = yv;
       plasma[index].curr_frame = 0;
  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.视频一区| 91精品国产91久久久久久一区二区| 91亚洲精品久久久蜜桃| 欧美精品日韩一区| 日本一区二区三区电影| 亚洲成av人影院在线观看网| 国产精品亚洲第一区在线暖暖韩国 | 国产三级精品在线| 一区二区三区蜜桃| 国产suv一区二区三区88区| 在线这里只有精品| 亚洲国产精品ⅴa在线观看| 日韩va欧美va亚洲va久久| 成人看片黄a免费看在线| 日韩午夜在线观看| 亚洲超碰精品一区二区| 91视频在线观看| 国产三级精品三级| 精品一区二区三区免费观看| 欧美日韩精品一区视频| 最新日韩av在线| 成人一道本在线| 国产亚洲1区2区3区| 久久国内精品自在自线400部| 欧美日韩久久久久久| 一区二区三区在线免费| 91色视频在线| 国产精品久久久久久久久久久免费看| 久久97超碰国产精品超碰| 日韩欧美国产精品一区| 首页国产欧美久久| 制服丝袜在线91| 日韩影视精彩在线| 在线不卡欧美精品一区二区三区| 亚洲在线免费播放| 欧美日韩在线三级| 日本亚洲视频在线| 欧美无人高清视频在线观看| 亚洲乱码国产乱码精品精的特点| 99久久婷婷国产综合精品| 欧美高清在线一区二区| 不卡视频在线观看| 亚洲私人影院在线观看| 色天天综合久久久久综合片| 亚洲伦理在线精品| 欧美视频你懂的| 日本午夜精品一区二区三区电影| 91高清视频在线| 日韩一卡二卡三卡四卡| 久久福利视频一区二区| 亚洲精品一线二线三线无人区| 国产一区二区三区在线观看免费视频| 久久婷婷国产综合精品青草| 国产.欧美.日韩| 亚洲欧美日本在线| 欧美肥妇bbw| 国产麻豆欧美日韩一区| 国产精品久久久久久福利一牛影视 | 中文字幕巨乱亚洲| 欧美在线999| 琪琪久久久久日韩精品| 久久精品综合网| 色婷婷激情综合| 美国精品在线观看| 国产精品二区一区二区aⅴ污介绍| 一本大道av伊人久久综合| 日韩电影免费一区| 欧美国产激情一区二区三区蜜月 | 欧美三片在线视频观看| 老司机免费视频一区二区| 欧美激情在线免费观看| 欧美性感一类影片在线播放| 久久精品国产久精国产| 亚洲三级在线免费观看| 日韩美女主播在线视频一区二区三区| 成人午夜激情影院| 日韩av中文字幕一区二区| 国产精品理论片| 日韩视频免费观看高清在线视频| 成人午夜激情视频| 久久成人免费网| 亚洲精品va在线观看| 精品国产伦一区二区三区观看方式 | 日本韩国一区二区三区视频| 久久精品国产亚洲a| 一区二区欧美精品| 国产日韩欧美一区二区三区综合| 欧美性xxxxx极品少妇| 国产成人av电影在线播放| 亚洲第一二三四区| 中文一区二区完整视频在线观看| 911精品国产一区二区在线| av一区二区三区在线| 狠狠色丁香婷婷综合| 亚洲 欧美综合在线网络| 中文在线免费一区三区高中清不卡| 日韩视频永久免费| 欧美无人高清视频在线观看| av在线播放不卡| 懂色av一区二区三区免费观看| 秋霞电影一区二区| 亚洲国产美国国产综合一区二区| 中文文精品字幕一区二区| 精品国产免费人成在线观看| 日韩三级视频在线看| 欧美日韩一级二级三级| 色综合久久中文字幕| 成人性色生活片免费看爆迷你毛片| 另类人妖一区二区av| 丝袜脚交一区二区| 性感美女久久精品| 亚洲一区二区欧美日韩| 亚洲激情欧美激情| 亚洲人成小说网站色在线| 亚洲色图一区二区| 欧美韩日一区二区三区四区| 久久久久久久久久久黄色| 欧美va日韩va| 日韩视频免费观看高清完整版在线观看 | 色婷婷综合在线| kk眼镜猥琐国模调教系列一区二区 | 欧美在线视频全部完| 91精品办公室少妇高潮对白| 91首页免费视频| 日本精品视频一区二区三区| 欧洲国产伦久久久久久久| 色综合色狠狠天天综合色| 99热精品一区二区| 色婷婷av久久久久久久| 欧美日韩一区视频| 337p亚洲精品色噜噜狠狠| 日韩欧美亚洲一区二区| 久久品道一品道久久精品| 国产欧美一区在线| 亚洲视频免费看| 亚洲国产精品嫩草影院| 婷婷丁香久久五月婷婷| 久久激情五月激情| 成人av网址在线| 在线影视一区二区三区| 在线成人高清不卡| 久久久国产精华| 亚洲色图都市小说| 亚洲国产精品影院| 国产一区激情在线| 色哟哟精品一区| 91精品视频网| 亚洲国产成人午夜在线一区| 亚洲已满18点击进入久久| 久久99在线观看| 99久久精品国产一区| 欧美高清www午色夜在线视频| 久久色视频免费观看| 亚洲美女视频在线| 男男视频亚洲欧美| 99久免费精品视频在线观看| 777奇米成人网| 欧美激情资源网| 日韩av中文字幕一区二区| 北岛玲一区二区三区四区| 欧美日韩精品欧美日韩精品| 久久婷婷色综合| 亚洲综合在线五月| 国产精品影音先锋| 欧美日韩午夜影院| 国产精品青草久久| 日韩国产精品大片| 91麻豆精品一区二区三区| 日韩精品一区二区在线观看| 亚洲人成影院在线观看| 国产盗摄一区二区| 91精品国产综合久久精品性色| 国产精品私人影院| 激情图片小说一区| 欧美日韩国产三级| 亚洲欧美日韩电影| 成人av午夜电影| 久久久99久久| 蜜桃在线一区二区三区| 欧美日韩在线播| 亚洲美女区一区| 成人精品视频一区二区三区尤物| 日韩精品专区在线| 手机精品视频在线观看| 欧美性受xxxx黑人xyx| 亚洲欧美色综合| 成人免费视频一区| 久久精品人人做| 国产在线播放一区三区四| 69p69国产精品| 亚洲成精国产精品女| 欧美视频精品在线| 亚洲理论在线观看| 91在线精品一区二区三区| 国产精品免费久久| 国产高清精品久久久久| 久久婷婷成人综合色| 精品一区二区免费| 精品黑人一区二区三区久久| 蜜桃视频在线一区|