[Solucionado] How do I save the global sound?

May I ask why do you want to save the object sprite? and more important, how can you be sure what value to assign to the volume based on the current sprite?

What you do is change the animation of the object, and each animation have their own sprites. Lets say each one is a single drawing, so both will have a sprite 0 and nothing else.
If you save the sprite value, with both options you’ll get a 0.

  • An easy way could be saving the direct value of the global sound.

  • Another way, using the sprite values, is putting both options (Si and No), in the same animation. Make the animation speed to 0 so they don’t change automatically. This way you’ll have a 0 sprite, and 1 sprite and you can use the same logic you are using right now. When “a” key is released, put the current frame to 1, when “c” key is released you put the frame as 1.

I hope this helps.

I was testing if I can save the sprite frame is in “if” the global sound is 0
sprite is “no” the global sound is 100

or can you tell me if there is another way to do it please

You can use regular number 0-100 in a number type variable
use sliders or tiled, patch-9 sprite to control the width and volume according to the with of the sprites

1 Like

Using the sprite option I made it work.

My object “Opciones” has a two sprite animation. Sprite 0 is no, sprite 1 is si (yes).

It does the trick, of course, but it could be easier if you save the Global sound level directly. A value between 0 and 100, as @UlisesFreitas states.

It is an interesting way to change the volume, I must say, and if you want to use it, this option works, just needs the little changes I show. Another thing to add could be the change of the current sprite of the “Opciones” object to the saved sprite, just after reading the value so the sprite shows the right sprite.

Again, I hope this helps you. :+1:

2 Likes