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

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.

主站蜘蛛池模板: 托克逊县| 兴国县| 崇文区| 九江县| 舒兰市| 陆良县| 拜城县| 磐石市| 禹州市| 三门峡市| 宣武区| 郸城县| 邯郸县| 屯留县| 正安县| 梁山县| 富蕴县| 涟源市| 罗源县| 晋城| 南昌市| 奇台县| 高青县| 嘉峪关市| 宿松县| 新宁县| 许昌市| 中江县| 青铜峡市| 漳州市| 桃源县| 新丰县| 乌苏市| 通海县| 双桥区| 八宿县| 宁强县| 承德县| 金秀| 常州市| 多伦县|