Open zachcowell opened 3 years ago
Not yet but definitely, I'll look into this next week!
so right now the tileset related supports are:
sliceX
and sliceY
field in loadSprite()
// slice the image into 12 x 3 = 36 frames with equal sizes
loadSprite("tileset", "path_to_image.png", {
sliceX: 12,
sliceY: 3,
});
// later in code...
add([ sprite("tileset", { frame: 12, }), ]);
2. manually pass in a `quad` field to `sprite()` component conf (just introduced to master in https://github.com/replit/kaboom/commit/e480fb5bf5c252b36e7325e79f83dc9c2f8d8c38)
```js
// will only draw the rectangle area of x: 0, y: 0, w: 0.2, h: 0.2 of the image
add([
sprite("tileset", { quad: quad(0, 0, 0.2, 0.2), }),
]);
i don't have a lot of experience using tilemaps, curious to know if you have any ideal API in mind for a code-only solution
does the slicer also support gaps between images? Sometimes free tilesets have:
Another exciting one to get would be animated tiles :)
they are fantastic for quick prototyping and gamejams btw. This capability will make kaboom the bomb on gamejam imo
Is there support for tilesets? I would like to create levels using a single tileset image and pass in indices of tile objects (instead of separate sprite images individually).
Great project btw! Very simple and fun to play with