Aller au contenu

Nouvelle image

  • Répertoireassets/
    • Répertoireshaders/
      • …
    • Répertoiresounds/
      • …
    • Répertoiresprites/
      • image.png
    • Répertoirestyle/
      • …
load.js
const PNG = [
"image",
"grass",
];
config.js
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(),
],
},
};
config.js
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(),
],
},
};
game.js
debug.inspect = true;
config.js
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(),
],
},
};