Are there any example projects we could open and learn from?
I created a map and then ran it, but it only showed black blank screen.
How do I create and place sprites?
Thanks.
Create 2D games in JavaScript, made easier · By
One of my old project MonkeyWarp (playable on itch) is open sourced on GitHub. It might mot be the easiest project to dive-in, but if you have some questions I'll try to answer them.
I plan to create some tutorials and more simple demo projects
To draw things on screen, you need to add some code to the "src/main.js" file. For example:
var map = getMap('map'); // get the TileMap named "map" draw(map, 0, 0); // draw map at position (0, 0) sprite(153, 64, 32); // draw sprite 153 (from tilesheet) at position (64, 32)
Full documentation can be found here
You can add png images in the "assets" folder of your project. Pixelbox will load these automatically, and you can draw them on the screen with some code like:
draw(assets.mySprite, 0, 0);
I second that request - couple basic example projects would be awesome to get a hang of the engine.
In the meantime @RocketStarGames, you can look up github for the project, the basic API is there.
Edit: Seems that the author beat me to a reply by 39s :P