Tileset support?
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
Not yet but definitely, I'll look into this next week!
so right now the tileset related supports are:
- you can slice images into frames by
sliceXandsliceYfield inloadSprite()
// 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, }),
]);
- manually pass in a
quadfield tosprite()component conf (just introduced to master in https://github.com/replit/kaboom/commit/e480fb5bf5c252b36e7325e79f83dc9c2f8d8c38)
// 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:
- margin around entire tileset
- padding between tiles opengameart and itch.io are a great place to check out free tilesets https://opengameart.org/art-search-advanced?keys=tile&title=&field_art_tags_tid_op=or&field_art_tags_tid=&name=&field_art_type_tid%5B%5D=9&sort_by=count&sort_order=DESC&items_per_page=24&Collection= https://limezu.itch.io/moderninteriors
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