Short delay after showing setSequence

Hi guys,

I’m writing a word game. If the incorrect answer was given, I would like to use setSequence to highlight the correct answer and then pause for about 500ms. The problem is that the code keeps running, and the setSequence never seems to display.

Code is:

    – FALSE

   

     for x = 1, #answerBox do

        if answerBox[x].correct == false then

        answerBox[x]:setSequence( “selected” )

        answerBox[x]:play()

    end

    end  

     for x = 1, #answerBox do

        if answerBox[x].correct == false then

            answerBox[x]:setSequence( “selected” )

        answerBox[x]:play()

    end

    end  

    starsEarned = starsEarned -1

       playAudio (audio.loadSound (“audio/wrong.wav”), true)

       transition.to( lives[livesCount], {y=screenBottom + 30, time=2000, alpha=0} )

       livesCount = livesCount -1

   

    disposeAnswers()

       if (livesCount <= 0) then

           gameOver (“lost”)

       else

        playGame()

       end

   end 

Hi @jilsx,

I think you’ll need to show the code where you’ve set up the sprite object, along with the sequence(s).

Also, please surround your code with “lua” tags for clarity in the forums:

[lua] --code [/lua]

Brent

Hi @jilsx,

I think you’ll need to show the code where you’ve set up the sprite object, along with the sequence(s).

Also, please surround your code with “lua” tags for clarity in the forums:

[lua] --code [/lua]

Brent