We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Help needed!!

Home Forums General Questions Help needed!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #49055
    troskhy
    Customer

    Hi all, i’m creating a simple game with right/wrong questions. Nothing fancy.

    The game works fine, it’s a set of 24 questions and when the user answers a question right, it creates a list with the answers and at the end of the game, it shows how many answers you’ve made correct.

    I took this idea from a project i saw in this forum.

    The data send to the list is by clicking one panel which sends the answer selected by the user.
    Now i want to add to this action, two sounds (right/wrong) depending if you hit the correct answer or not.

    The idea is once the user sends the information, the list is checked and if the right answer is stored, plays a sound or other.

    I attach 2 stills of my puzzles, one with the panel which is use as trigger to store the info everytime the user clicks to send the info and the other the procedure that i use to check the correct answer and store it in the list.

    Any help would be highly appreciated!!

    Troskhy

    Attachments:
    You must be logged in to view attached files.
    #49080

    hi,

    it’s kinda difficult to say what is wrong as there are too many puzzles in your setup. But the general idea can be that you can compare the user answer with the correct answer stored in the list, and if there is a match, play ‘correct’ sound, otherwise play ‘wrong’ sound.

    Chief 3D Verger | LinkedIn | Twitter

    #49082
    xeon
    Customer

    Hi there,
    Playing short sound effects sounds is unique and is even more unique when it comes to various devices and the limiting factor that we only have one processing thread to get them played back and still have interactivity.

    If you haven’t already you should initialize the loading of the sounds. Preload your sounds in your Init Tab. This will insure they will be ready to play. If you also plan on letting people play this on mobile devices you should create a touch even to preload them for mobile.

    Once these items are done they will playback as fast as possible since they will be in memory.

    Lastly, I would suggest putting your audio playback call into a procedure and prioritizing the playback so that these procedures are only called when necessary not on click. This may be your intent…I don’t know your design requirements.

    Currently, you have a beep then a start sound in the onclick. Depending on the computer and editing of the tracks these may play very close to each rather than the spacing you intend. Since I don’t know how you are really using them you and you are triggering them simultaneously, you might want to just edit the sound into one file and save yourself some memory and load time.

    Since it seems you only want the sound to trigger when an answser is correctly I would create a procedural call to play the audio.

    Something like:
    if ANS1 = 9
    Play sound1 (a procedure call)
    do set correct count to 1
    Play sound2( a procedure call)
    end if

    Sound1 (Procedure1)
    Play sound1
    etc..

    Depending on how fast user can cycle through the answers, you will have to worry about whether audio playback is overlapping and create logic to make sure only one sound is playing at a time if needed.
    This is also a good spot to put a volume controller for a game so the user can adjust the volume.

    Good luck

    Attachments:
    You must be logged in to view attached files.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #49131
    troskhy
    Customer

    Hi @xeon and Yuri thanks for your response!

    I followed your suggestion but came with a weird behaviour, i’ll explain it.

    I removed all my sounds and let (for testing) my 2 right/wrong sounds.
    These are preloaded in the init tab, and made a procedure calling them.

    I placed them in the first question, just to try this.

    The sounds plays when all the 24 questions has been answered, no when the send button is clicked for the first question.

    I attach a screenshot with my puzzle set up again with the config, as i’m convinced that i’m doing something wrong but i cannot see it :-( :-(

    Hope you can help me to get this thing work.

    Thanks in advanced,

    Troskhy

    Attachments:
    You must be logged in to view attached files.
    #49156

    Hi,

    in your puzzles the sounds are played when the ‘getscore’ procedure is invoked. If ‘getscore’ is triggered in the end of the quiz, the sound will only be played once.

    Chief 3D Verger | LinkedIn | Twitter

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.