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

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.

主站蜘蛛池模板: 台南县| 兴城市| 瑞丽市| 云和县| 玉田县| 凤庆县| 博白县| 抚顺县| 成安县| 宜城市| 达孜县| 临高县| 河南省| 中江县| 晋州市| 陕西省| 米脂县| 清新县| 八宿县| 京山县| 弥勒县| 南澳县| 视频| 裕民县| 集安市| 昌平区| 东乡族自治县| 象山县| 孙吴县| 突泉县| 洛南县| 集安市| 大理市| 南汇区| 松潘县| 荃湾区| 同江市| 北海市| 石屏县| 汝阳县| 宜兴市|