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

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.

主站蜘蛛池模板: 绥江县| 岳普湖县| 龙江县| 内黄县| 曲阳县| 湛江市| 托克托县| 海丰县| 革吉县| 辽阳市| 遂溪县| 宝山区| 五大连池市| 凤庆县| 玉林市| 彭山县| 安顺市| 建平县| 清镇市| 宁蒗| 瓮安县| 伊宁县| 阿拉善盟| 衡东县| 开化县| 徐闻县| 刚察县| 云龙县| 云浮市| 神木县| 门头沟区| 利辛县| 清水河县| 饶河县| 厦门市| 沙坪坝区| 都昌县| 彰化县| 新津县| 麻阳| 兴化市|