Change tilemap to dimension and simple generation

This commit is contained in:
2026-03-06 15:46:42 -03:00
parent 0f3f8de735
commit e5d2a3e7e2
20 changed files with 137 additions and 186 deletions
+13
View File
@@ -26,3 +26,16 @@ export function screen_to_world(
y: (screen_y - screen_height / 2) / camera.zoom + camera.y,
};
}
export function world_to_screen(
world_x: number,
world_y: number,
camera: Camera,
screen_width: number,
screen_height: number,
) {
return {
x: (world_x - camera.x) / camera.zoom + screen_width / 2,
y: (world_y - camera.y) / camera.zoom + screen_height / 2,
};
}