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

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.

主站蜘蛛池模板: 永吉县| 五台县| 徐闻县| 延川县| 南涧| 兴义市| 菏泽市| 广州市| 平潭县| 彭州市| 邻水| 辽阳市| 外汇| 灌南县| 雷波县| 岳阳市| 台东市| 清水河县| 田林县| 兴仁县| 巩义市| 深泽县| 天镇县| 岳池县| 长海县| 时尚| 平阴县| 塘沽区| 孟州市| 广州市| 龙江县| 南昌市| 德钦县| 澄江县| 黄冈市| 措美县| 大同市| 南华县| 运城市| 凤城市| 吴川市|