Advertisement

sounds happen -1 step?

Started by May 03, 2002 09:28 AM
2 comments, last by edwinnie 22 years, 7 months ago
okie, i have 2 wav files. wave 1 is to be played during menu time. wave 2 is to be played during main game time. considering that menu time is during game_main, how come i have to put wave 1 during game_init, so that it can be played during menu_time? same goes for wave 2, i have to put in menu time, so that it can be played during main game time.
Put it in? You mean start playing?
Advertisement
ok a clearer example>

game_init()
{

game_state = GAME_STATE_INIT;
if(game_state == GAME_STATE_INIT)
{
..
}

DSoundPlay("wave1.wav");
//if menu music is to be heard, why i have to put here?

//last line
game_state = GAME_STATE_MENU;

}//end game_init


game_main()
{

if(game_state == GAME_STATE_MENU)
{
..
DSoundPlay("wave2.wav");
//if main game music is to be heard, why i have to put here?
//considering that GAME_STATE_RUN is not yet called!

}

game_state = GAME_STATE_RUN;
...
}//end game_main

[edited by - edwinnie on May 3, 2002 11:01:53 AM]
Do you continually tell it to play? You should probably only tell it to play when the game is done loading, and end it. Or do a check to see if it isn''t playing, and play it (if wanted). I don''t know if this is your problem.


Would telling a wav to play over, and over , make it restart? It may, but i''ve never done this. If it does then would you hear it? I will answere my own question, it probably depends (right?), but you keep (possibly) restarting the wav and when you leave Init or Menu then it isn''t being restarted anymore, so it plays through.. make sense? I think it does, but I''m not the brightest something or other in a group or similar.
I'm not the brightest something or other in a group or similar.~ me ~

This topic is closed to new replies.

Advertisement