Configurer des niveaux
Fanny
Configuration pour l’ensemble des niveaux
Section intitulée « Configuration pour l’ensemble des niveaux »const TILE_CONFIG = {
"#": () => [ // player 1 sprite("bean"), platformerController(), jumpController(), sleep(), alive(), opacity(), scale(), health(1, 4), area(), body(), respawn(), falling(), rotate(), pos(0, -20), anchor("center"), ],
"=": () => [ // block sprite("grass"), area({ collisionIgnore: ["agent"] }), body({ isStatic: true }), anchor("bot"), offscreen({ hide: true }), tile({ isObstacle: true }), ],
}Configuration pour un niveau
Section intitulée « Configuration pour un niveau »const LEVELS = [
// niveau 0 { map: `
# ===========
`, config:{ tileWidth: 64, tileHeight: 64, backgroundColor: "afe1ff", gravity: 3200, tiles: { "=": () => [ // bloc sprite("grass"), area(), body({ isStatic: true }), anchor("bot"), offscreen({ hide: true }), ], }, } },
];