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

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.

主站蜘蛛池模板: 昌吉市| 兴隆县| 牡丹江市| 焉耆| 虞城县| 民县| 城口县| 会同县| 湄潭县| 武威市| 德安县| 湘乡市| 镇远县| 赣州市| 温州市| 乾安县| 惠来县| 金寨县| 沂源县| 土默特右旗| 无锡市| 张家口市| 金乡县| 寻乌县| 潼关县| 商都县| 尉犁县| 甘泉县| 监利县| 富川| 兰溪市| 普兰县| 永福县| 高阳县| 吉水县| 麻栗坡县| 衡山县| 德安县| 刚察县| 漳州市| 大荔县|