这篇教程C++ snd_play函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中snd_play函数的典型用法代码示例。如果您正苦于以下问题:C++ snd_play函数的具体用法?C++ snd_play怎么用?C++ snd_play使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了snd_play函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: trigger_visibleaction trigger_visible (){ VECTOR vecTemp; while(1) { vec_set(vecTemp, my.x); if (vec_to_screen(vecTemp, camera) != NULL) { switch(my.skill1) { case 0: snd_play(snd_narrator_start, 100, 0); break; case 1: snd_play(snd_narrator_sky, 100, 0); break; case 2: snd_play(snd_narrator_enemy, 100, 0); break; case 3: snd_play(snd_narrator_lottifant, 100, 0); break; } break; } wait(1); }}
开发者ID:Acknex,项目名称:Prince-of-Lotteria,代码行数:27,
示例2: msg_minesint msg_mines (int n, int msg, int z) { // space mines int sh, x, y; switch (msg) { case msg_update: objs[n].count = (objs[n].count + 1)&3; return (1); case msg_draw: sh = 0xf00 + 18 + objs[n].count/2; drawshape (&gamevp, sh, objs[n].x, objs[n].y); break; case msg_touch: switch (objs[z].kind) { case obj_player: if (class_cnt(class_shield)==0) { p_hit (2); snd_play (1,5); x = objs[n].x - 11; y = objs[n].y - 9; addobj (obj_explode3, x, y, 0, 0); explosion (objs[n].x, objs[n].y, 5); text ("You hit an enemy space mine!",0); killobj (n); }; break; case obj_shield: addobj (obj_explode2, objs[n].x, objs[n].y, 0, 0); explosion (objs[n].x, objs[n].y, 5); text ("Your shield was destroyed by a space mine",0); killobj (n); killobj (z); snd_play (1,5); }; }; return (0); };
开发者ID:dos-games,项目名称:vanilla-kiloblaster,代码行数:27,
示例3: supernova_processvoid supernova_process(){ int sn_stage; // if the supernova is running sn_stage = supernova_active(); if(sn_stage) { Supernova_time -= flFrametime; // sound stuff if((Supernova_time <= SUPERNOVA_SOUND_1_TIME) && !Supernova_sound_1_played) { Supernova_sound_1_played = 1; snd_play(&Snds[SND_SUPERNOVA_1], 0.0f, 1.0f, SND_PRIORITY_MUST_PLAY); } if((Supernova_time <= SUPERNOVA_SOUND_2_TIME) && !Supernova_sound_2_played) { Supernova_sound_2_played = 1; snd_play(&Snds[SND_SUPERNOVA_2], 0.0f, 1.0f, SND_PRIORITY_MUST_PLAY); } // if we've crossed from stage 1 to stage 2 kill all particles and stick a bunch on the player ship if((sn_stage == 1) && (supernova_active() == 2)) { // first kill all active particles so we have a bunch of free ones particle_kill_all(); } // if we're in stage 2, emit particles if((sn_stage >= 2) && (sn_stage != 5)) { supernova_do_particles(); } // if we've got negative. the supernova is done if(Supernova_time < 0.0f) { Supernova_finished = 1; Supernova_fade_to_white += flFrametime; // start the dead popup if(Supernova_fade_to_white >= SUPERNOVA_FADE_TO_WHITE_TIME) { if(!Supernova_popup) { // main freespace 2 campaign? if so - end it now // // don't actually check for a specific campaign here since others may want to end this way but we // should test positive here if in campaign mode and sexp_end_campaign() got called - taylor if (Campaign_ending_via_supernova && (Game_mode & GM_CAMPAIGN_MODE) /*&& !stricmp(Campaign.filename, "freespace2")*/) { gameseq_post_event(GS_EVENT_END_CAMPAIGN); } else { popupdead_start(); } Supernova_popup = 1; } Supernova_finished = 2; } } }}
开发者ID:DahBlount,项目名称:Freespace-Open-Swifty,代码行数:54,
示例4: ebHandsBgFlyvoid ebHandsBgFly (){ if (isEbWarghostAlive()) { var handRadius = 500; snd_play(g_sndSparkle, 100, 0); ENTITY* hands [2]; hands[0] = ent_create("warhand.mdl", vector(-handRadius, 500, 400), ebHandFlyL); hands[1] = ent_create("warhand.mdl", vector(handRadius, 500, 400), ebHandFlyR); var t = maxv(g_facTimeEbHandsFlyMin, g_facTimeEbHandsFly * (5 + random(5))) * 16; snd_play(g_sndHandFlyBoth, 100, 0); while (t > 0) { t -= time_step; wait(1); } g_facTimeEbHandsFly *= g_facTimeEbHandsFlyDec; ebSndAttack(); int i; var m = (1 + random(2)) * 16; for (i = 0; i < 2; i++) { (hands[i])->skill1 = 1; (hands[i])->skill2 = m; } while (m > 0) { m -= time_step; wait(1); } snd_play(g_sndSparkle, 100, 0); wait(-0.5); VECTOR v; vec_set(&v, player->x); v.z += 400; ent_create("warhand.mdl", &v, ebHandWatchSelect); } ptr_remove(my);}
开发者ID:Acknex,项目名称:Prince-of-Lotteria,代码行数:53,
示例5: msg_shieldint msg_shield (int n, int msg, int z) { int sh; switch (msg) { case msg_update: if (objs[n].count2 >= 240) objs[n].count = (objs[n].count + 1)&3; move_obj (n, objs[0].x-2, objs[0].y-2); if (++objs[n].count2==340) killobj (n); return (1); case msg_draw: sh = 0x804 + objs[n].count/2; drawshape (&gamevp, sh, objs[n].x, objs[n].y); break; case msg_touch: switch (objs[z].kind) { case obj_enemy1: case obj_enemy2: case obj_enemy3: case obj_enemy4: case obj_enemy5: case obj_enemy6: case obj_enemy7: case obj_enemy8: case obj_enemy9: case obj_enemya: case obj_enemyb: case obj_enemyc: case obj_enemyd: case obj_enemye: case obj_enemyf: case obj_enemyg: case obj_enemyh: case obj_enemyi: case obj_enemyj: case obj_enemyk: snd_play (1,7); if (objs[z].count3 < 1) { killobj (z); } else { objs[z].xd = -objs[z].xd; objs[z].yd = -objs[z].yd; }; break; case obj_bullet2: case obj_spinner: case obj_laser: snd_play (1,7); explosion (objs[z].x, objs[z].y, 5); killobj (z); }; }; return (0); };
开发者ID:dos-games,项目名称:vanilla-kiloblaster,代码行数:50,
示例6: ebStartSpeechaction ebStartSpeech (){ set(my, INVISIBLE | PASSABLE); // wait var t = 3 * 16; while (t > 0) { t -= time_step; wait(1); } if (g_ebSpeech) { g_ebSpeech = false; var h = snd_play(g_sndWarghostBattleSpeechStart, 100, 0); while (snd_playing(h)) wait(1); } // switch warghost to model without hands if (g_entEbWarghost != NULL) ent_morph(g_entEbWarghost, "warghostChop.mdl"); ent_create(NULL, nullvector, ebHandsBgFly); ptr_remove(my);}
开发者ID:Acknex,项目名称:Prince-of-Lotteria,代码行数:28,
示例7: mission_maybe_play_directive_success_sound// Maybe play a directive success sound... need to poll since the sound is delayed from when// the directive is actually satisfied.void mission_maybe_play_directive_success_sound(){ if ( timestamp_elapsed(Mission_directive_sound_timestamp) ) { Mission_directive_sound_timestamp=0; snd_play( &Snds[SND_DIRECTIVE_COMPLETE] ); }}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:9,
示例8: playTauntvoid playTaunt(int index){ if (g_num_taunts[index] > 0) { int sndIndex = 0; if (g_num_taunts[index] > 1) { sndIndex = (int) random(g_num_taunts[index]); } if (g_tauntHandles[index] != 0) { snd_stop(g_tauntHandles[index]); g_tauntHandles[index] = 0; } SOUND** sndArr = g_taunts[index]; if (sndArr != null) { SOUND* snd = sndArr[sndIndex]; if (snd != null) { g_tauntHandles[index] = snd_play(snd, g_tauntVolume, 0); } } }}
开发者ID:Acknex,项目名称:Ackmania,代码行数:25,
示例9: snd_play/*--------------------------------------------------------------------------------*| <<< パンチ >>>*---------------------------------------------------------------------------------*/void cPlayer::Punch(void){ for(int i = 0; i < PLAYER_PUNCH_MAX; i++) {//一回目 左 //二回目 右 //--- パンチを出す C++ snd_power_change_state函数代码示例 C++ snd_pcm_writei函数代码示例
|