})();
const Map = ((grid = new Uint8Array(MAP_SIZE ** 2))=>{
- return {
- get: (x, y)=>(grid[Math.floor(y) * MAP_SIZE + Math.floor(x)] || -1),
- randomize: ()=>(grid = grid.map((i) => (Math.random() < 0.3 ? 1 : 0))),
- };
+ grid = grid.map((i) => (Math.random() < 0.3 ? 1 : 0));
+ return { get: (x, y)=>(grid[Math.floor(y) * MAP_SIZE + Math.floor(x)] || -1) };
})();
const Camera = ((self = {}, columns = [], ceiling = null, floor = null)=>{
})();
(() => {
- Map.randomize();
const loop = (now) => {
const seconds = FrameTimer.update(now);
Player.update(seconds);