Sound Emission
Markinhos
Member Posts: 17
Hello, I would like to know how to do sound for an actor only when he is on the screen.
Comments
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Desmarquei "loop"
Desmarquei "run to completion"
Desmarquei "Positional sound"
Desmarquei "Velocity Shift"
I also tried with the options checked.
If I leave "Run to completion" marked. The sound is executed when the game starts.
I tested it last night and it worked as expected on my end. I can certainly give you the file if you need it but it should be very straight forward.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
The hero walks 2,000 pixels. When the hero arrives on the actor, and the actor appears on screen it should output the sound.
But based on what you just described I'd do this instead:
Hero walks across screen and arrives on 'the actor' -
Make a Rule, when the hero collides with the actor play your sound and display 'the other actor' (if there is one)
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
As the "second actor" appears on the screen, the "second actor" should make a sound.
How to do it?
I do not have to use "bump" because the "second actor" is at the top of the screen. They do not collide.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Please download the file in the link:
http://www.jogai.com/test-som.zip
Your sound actor is placed in the game (off screen technically, but in the game) at the start, that is why the sound is firing immediately.
If you want the sound to play only when the player character reaches the point of the "automatic sound now" spot you need to add a rule to the player to trigger the sound at that point. You could do this through a collision as I suggested above, of you could trigger it when you player reaches a certain X position.
But you can't set it off just by placing your sound actor in the game because as you can see, it fires as soon as the current sound actor is active, which is immediately.
Does the 'automatic sound now' actor serve any other purpose besides playing the sound? If not you won't need this actor at all. You would just play the sound from the behaviors in the player character.
Hope that helps.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page