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

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.

主站蜘蛛池模板: 游戏| 南投市| 宁河县| 乐陵市| 武功县| 二连浩特市| 嘉善县| 新闻| 荔浦县| 舒城县| 天镇县| 黄山市| 镶黄旗| 通许县| 宁化县| 沙湾县| 呼伦贝尔市| 屏山县| 荥经县| 宁海县| 保靖县| 丰宁| 福建省| 慈利县| 伊宁市| 德安县| 汉寿县| 马龙县| 荣昌县| 鄢陵县| 宝兴县| 滦南县| 鹰潭市| 柳河县| 苏尼特左旗| 庄河市| 阿图什市| 故城县| 如皋市| 璧山县| 吉安县|