Insert Music in game !
venon_it
Member, PRO Posts: 594
Hi Staff,
i'm an italian People, sorry for my English,
I am creating my first game, I wanted to know some information, to insert a Background music.
1) add music throughout the game, from the first scene to last scene.
2) Alternatively, add music to each scene
and all possibility with the ability to play/stop the music button
Thanks to all Venon
i'm an italian People, sorry for my English,
I am creating my first game, I wanted to know some information, to insert a Background music.
1) add music throughout the game, from the first scene to last scene.
2) Alternatively, add music to each scene
and all possibility with the ability to play/stop the music button
Thanks to all Venon
Comments
There is a behavior called 'Play Music'. http://gamesalad.com/wiki/behaviors_reference:play_music
It accepts .aac and .m4a audio files to be used as background music.
Only one background music can play at one time. It continues throughout scene changes and can be paused with the 'Pause Music' behavior, resumed with the 'Play Music' behavior set to 'resume current music', stopped with the 'Stop Music' behavior, and replaced with a different music file with the 'Play Music' behavior.
now i create one button and insert "RULE" ---> "actor recieve event" ---->> mouse button-->> " down "
and insert "PLAY MUSIC" ( with music )
but when start the game, i push the button MUSIC , music start, after a create another button to START a game, and it start second Scene, and after the Music restart!!! it is not good..the music starts twice!
Help Me pleaseee
Thanks!
This may help you along in understanding attributes:
http://gamesalad.com/wiki/how_tos:gsc_create_attribute\
This one for buttons:
http://gamesalad.com/wiki/how_tos:gsc_create_a_button
And this one for the expression editor:
http://gamesalad.com/wiki/interface_reference:expression_editor
This may help you along in understanding attributes:
http://gamesalad.com/wiki/how_tos:gsc_create_attribute\
This one for buttons:
http://gamesalad.com/wiki/how_tos:gsc_create_a_button
And this one for the expression editor:
http://gamesalad.com/wiki/interface_reference:expression_editor
i want for first insert a music with a button in menu, but want to have a possibility to stop/pause in every scene or have a possibility to insert a different button/music for every scene.
For second want to create one button SOUND, i push down the button and start a small sound...
Now i create and add a new actor, insert a image, crate a "RULE" ---> "actor recieve event" ---->> mouse button-->> " down "
and insert "PLAY SOUND" ( with sound.ogg ) with flag "Run to completition"
But if i push the button on every section of screen the sound "start" !!! it is not good! because i want to insert more button with a different sound...and if i click in every section of screen "start all sound" !!!!
help Me thanksss
I am attaching the link with a screen.
thanks
http://img121.imageshack.us/i/gamesaladmusic01.jpg/
( i create a "game" attribute called music (integer set to 0) and "game" called "attribute " for insert "game.attribute" in a rule
Help
Now understand, i try in all mode, and don't function...for me the problem is in the first step, i don't have " Attribute Called : attribute " and when i typing " Attribute: game.attribute " i have an a problem....after i create a attribute denominate " attribute" for insert " game.attribute "
and don't have a problem, but don't function...
you see my screen? is all ok?
Thanksssss
Have it check if that attribute is 0 or 1 (depending if it is play or stop) and just have the Music behaviors there. You don't need the Change Attribute behaviors in those rules.
Also for your first rule, you may want to look for Touch Pressed instead of Mouse Button Down.
( i try to insert a pause function.. but don't function... )
Thankssss
you can see my setup : http://img132.imageshack.us/i/games01.jpg/
i try to change first rule (Mouse Button Down) in Touch Pressed but result is the same
Thankksss for help mee