Skip to content

Commit

Permalink
Adjust background generation offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Nov 5, 2024
1 parent adc4123 commit 386db9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 3 additions & 7 deletions renderer/Background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export const BITMASK_TO_TILE_INDEX = {
} as const;

const neighborOffsets = [
[0, -1],
[1, -1],
[1, 0],
[1, 1],
[0, 1],
[-1, 1],
[1, 0],
[-1, 0],
[1, -1],
[0, -1],
[-1, -1],
] as const;

Expand Down Expand Up @@ -118,10 +118,6 @@ export async function generateBg(

for (let y = 0; y < map.length; y++) {
for (let x = 0; x < map[y].length; x++) {
if (map[y][x] !== "R") {
continue;
}

const bitMask = getBitMask(map, x, y);
const tileIdx = BITMASK_TO_TILE_INDEX[bitMask];

Expand Down
3 changes: 2 additions & 1 deletion renderer/Renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export class Renderer {
return assets.player;
}
case EntityType.Rock: {
return assets.rock;
// return assets.rock;
return null;
}
case EntityType.Zombie: {
if (entity.hasVisualEvent(VisualEventType.Destructured)) {
Expand Down

0 comments on commit 386db9f

Please sign in to comment.