Ajouter des images
Téléverser un fichier
Section intitulée « Téléverser un fichier »Répertoireassets/
Répertoireshaders/
- …
Répertoiresounds/
- …
Répertoiresprites/
- image.png
Répertoirestyle/
- …
Charger le fichier
Section intitulée « Charger le fichier »const PNG = [ "image", "grass",];Utiliser l’image
Section intitulée « Utiliser l’image »const LEVEL_CONFIG = {
tileWidth: 64, tileHeight: 64, backgroundColor: "afe1ff", gravity: 3200,
tiles: {
'#': () => [ // player 1 sprite('image'), platformerController(), alive(), opacity(), scale(), health(1, 4), area(), anchor('bot'), body(), respawn(), falling(), coloring(), animator(), ],
},};Modifier la taille de l’image
Section intitulée « Modifier la taille de l’image »const LEVEL_CONFIG = {
tileWidth: 64, tileHeight: 64, backgroundColor: "afe1ff", gravity: 3200,
tiles: {
'#': () => [ // player 1 sprite('image',{width: 64, height: 64}), platformerController(), alive(), opacity(), scale(), health(1, 4), area(), anchor('bot'), body(), respawn(), falling(), coloring(), animator(), ],
},};Modifier la taille de la boite de collision
Section intitulée « Modifier la taille de la boite de collision »debug.inspect = true ;const LEVEL_CONFIG = {
tileWidth: 64, tileHeight: 64, backgroundColor: "afe1ff", gravity: 3200,
tiles: {
'#': () => [ // player 1 sprite('image',{width: 64, height: 64}), platformerController(), alive(), opacity(), scale(), health(1, 4), area({scale: vec2(0.5, 0.5)}), anchor('bot'), body(), respawn(), falling(), coloring(), animator(), ],
},};