speice.io/blog/2024-11-15-playing-with-fire/1-introduction/cameraGasket.ts

10 lines
173 B
TypeScript
Raw Normal View History

export function camera(
size: number,
x: number,
y: number
): [number, number] {
return [
Math.floor(x * size),
Math.floor(y * size)
];
}