add world utility function for setting tiles to empty.
This commit is contained in:
parent
b886a3a965
commit
7c7d939905
|
@ -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", _ => {
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue