Inverser la gravité
Léomyl
Modifier un symbole
Section intitulée « Modifier un symbole »config.js "#": () => [ // player 1gravitySwitchController(),spriteFacing({facingX:false}),"gravity",sprite("bean"),platformerController(),jumpController(),sleep(),alive(),opacity(),scale(),health(1, 4),area(),body(),respawn(),falling(),rotate(),pos(0, -20),anchor("center"),],Lancer une animation
Section intitulée « Lancer une animation »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([multiplayerCamera(),])setGravity(config.gravity)setBackground(config.backgroundColor)on('reverse gravity', 'player', (obj) => obj.play('jump', { speed: 4, onEnd: () => obj.play('idle') }))on('reverse gravity', 'player', () => play('wooosh'))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'))}
Paramètres
Section intitulée « Paramètres »platformerController()
exampleconfig.js
platformerController({ leftKey: "left", rightKey: "right", moveSpeed: 480, glideDelay: 0.1, moveReductionDelay: 0.1}),