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

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.

主站蜘蛛池模板: 彰化市| 新野县| 蕉岭县| 台北市| 和田市| 泸溪县| 南平市| 昌图县| 南开区| 云阳县| 都江堰市| 鹤山市| 达拉特旗| 石林| 仁化县| 都安| 富民县| 武义县| 玛曲县| 嵊泗县| 信宜市| 精河县| 禹州市| 朝阳县| 石城县| 叙永县| 彭州市| 冀州市| 太仓市| 新津县| 德阳市| 洪江市| 巫溪县| 泸溪县| 庐江县| 腾冲县| 绥江县| 张家界市| 漳平市| 保定市| 沙田区|