Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Pixelbox

Create 2D games in JavaScript, made easier · By Cedric Stoquer

does not load the map

A topic by Bagi created May 15, 2021 Views: 268 Replies: 1
Viewing posts 1 to 2

in my pixelbox is not loading the map I created

code:

var character = {

    x: 60,

    y: 60

};

var background = getMap("map");

paper(7);

exports.update = function () {

    if (btn.right) character.x += 1;

    if (btn.left)  character.x -= 1;

    if (btn.up)    character.y -= 1;

    if (btn.down)  character.y += 1;

    cls();

    draw(background, 0, 0);

    sprite(153, character.x, character.y);

};

what is wrong?

Are you sure your map has been named “map”? Name is case-sensitive. You can rename a map from the map editor (first text input in the top).

Alternatively, you can also get a map by its number: You can try var background = getMap(0);.