官术网_书友最值得收藏!

Sound

Sound is one of the most important but often neglected pieces of game design. Good sound design can add a huge amount of juice to your game for a very small amount of effort. Sounds can give the player feedback, connect them emotionally to the characters, or even be a part of the gameplay.

For this game, you're going to add three sound effects. In the Main scene, add three AudioStreamPlayer nodes and name them CoinSound, LevelSound, and EndSound. Drag each sound from the audio folder (you can find it under assets in the FileSystem dock) into the corresponding Stream property of each node.

To play a sound, you call the play() function on it. Add $CoinSound.play() to the _on_Player_pickup() function, $EndSound.play() to the game_over() function, and $LevelSound.play() to the spawn_coins() function.

主站蜘蛛池模板: 梁山县| 广汉市| 河北省| 马公市| 西平县| 建始县| 临朐县| 油尖旺区| 佛冈县| 霸州市| 潍坊市| 凤冈县| 桑日县| 体育| 阿坝县| 泰宁县| 丹江口市| 德昌县| 红安县| 吴川市| 德昌县| 阿瓦提县| 漳平市| 固镇县| 南靖县| 陵川县| 同江市| 阳城县| 德江县| 苍梧县| 迁安市| 体育| 格尔木市| 宁陕县| 定西市| 乃东县| 襄城县| 长岭县| 历史| 南召县| 张家川|