add world utility function for setting tiles to empty.

This commit is contained in:
HyperOnion 2023-06-28 15:08:03 +02:00
parent e3b91c2341
commit 1dcae8d8c6
2 changed files with 5 additions and 1 deletions

View File

@ -33,7 +33,7 @@ on_press(" ", _ => {
});
function clear_tile (x, y) {
world.set_tile(player.box, x, y, world.empty_tile());
world.clear_tile(player.box, x, y);
}
on_press("Backspace", _ => {

View File

@ -33,6 +33,10 @@ export function get_tile (world, x, y) {
return world.tiles[x][y];
}
export function clear_tile (box, x, y) {
set_tile(box, x, y, empty_tile());
}
export function create_box (parent) {
return {
...create_world(BOX_SIZE),