Fond sonore
Ismaël
Le son permet de donner une identité sonore au jeu et favoriser l’immersion du joueur.
Charger un son
Section intitulée « Charger un son »load.js const MP3 = ["tough zombeat","wooosh","off",]modifier la scène
Section intitulée « modifier la scène »game.js scene("game", () => {const tiles = { ...TILE_CONFIG, ...LEVELS[CURRENT_LEVEL].tiles }const config = { ...LEVEL_CONFIG, ...LEVELS[CURRENT_LEVEL].config, ...{tiles:tiles}}const map = LEVELS[CURRENT_LEVEL].map.split('\n')const level = addLevel(map, config)const utility = add([music(config),multiplayerCamera(),])setGravity(config.gravity)setBackground(config.backgroundColor)on('jump', 'player', () => play('wooosh'))on('drop', 'player', () => play('off'))on('respawn', 'player', (obj) => obj.play('idle'))on('sleep', 'player', (obj) => obj.play('sleep'))on('awake', 'player', (obj) => obj.play('idle'))on('jump', 'player', (obj) => obj.play('jump', { speed: 4, onEnd: () => obj.play('idle') }))on('drop', 'player', (obj) => obj.play('worry'))}configurer les niveaux
Section intitulée « configurer les niveaux »config.js level not found