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

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.

主站蜘蛛池模板: 陕西省| 安乡县| 抚宁县| 宁安市| 濮阳市| 乃东县| 江陵县| 浏阳市| 潜江市| 江阴市| 平阳县| 行唐县| 石楼县| 崇礼县| 湟中县| 丰都县| 博罗县| 镇江市| 赣州市| 工布江达县| 射洪县| 普陀区| 霍林郭勒市| 锦屏县| 林芝县| 吉木乃县| 巴林右旗| 宁陵县| 肃北| 衡阳县| 灵武市| 云龙县| 大荔县| 西宁市| 清新县| 祁东县| 融水| 革吉县| 贵溪市| 浪卡子县| 含山县|