Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Help needed with xna/c# error

  • 07-03-2009 3:47pm
    #1
    Registered Users, Registered Users 2 Posts: 6,536 ✭✭✭


    Hey making a game in xna for a project. Im implementing music at the minute.

    Basically I have a title screen no music once the player hit starts the game the music plays no problem. I have 3 lives and at first my music played continuously even if i died so i put in music.Stop(AudioStopOptions.AsAuthored); if my if statement when my lives are gone.

    When i die it send me back to the title screen but for somereason it throws up an error when i start the game again saying InvalidOperationException

    so even though the music.play works at the beginning when i die and am thrown back to the title screen it doesnt??

    protected void StartNewGame()
    {
    _GameStarted = 1;
    _LivesLeft = 3;
    player.ScrollRate = 0;
    _playerScore = 0;
    _GameWave = 0;
    music.Play();


    StartNewWave();
    }

    theres my startnewgamemethod that picks out the music.play as an error ONLY when i loose my 3 lives.

    if (_LivesLeft > 0)
    {
    PlayerKilled();

    StartNewWave();
    }
    else
    {
    music.Stop(AudioStopOptions.AsAuthored);
    _GameStarted = 0;
    _ProcessEvents = 1;
    }

    thats where i stop the music playing if i die.

    Can anyone help??


Comments

  • Closed Accounts Posts: 5,482 ✭✭✭Kidchameleon


    Are you updating your audio engine in the update member? Sounds like your just updating it at certain times... Can you post complete source?


Advertisement