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

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.

主站蜘蛛池模板: 新疆| 呼玛县| 柳州市| 锦屏县| 宽甸| 开平市| 伊通| 莱阳市| 云安县| 汪清县| 犍为县| 丰镇市| 庄河市| 芦山县| 铜川市| 边坝县| 陵水| 双牌县| 凭祥市| 临朐县| 蚌埠市| 南皮县| 安溪县| 安阳市| 鲁山县| 冀州市| 镇坪县| 深圳市| 台州市| 襄垣县| 天津市| 廉江市| 齐河县| 余江县| 潜江市| 双城市| 乐至县| 龙游县| 忻州市| 政和县| 广汉市|