Skip to content

Commit

Permalink
Add linewidth 1 + no sub pixel rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
bouveng committed Jun 19, 2020
1 parent 0bc269e commit a24a4a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions public/js/layers/collision.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ function createEntityLayer(entities) {
entities.forEach(entity => {
context.beginPath();
context.rect(
entity.bounds.left - camera.pos.x,
entity.bounds.top - camera.pos.y,
entity.size.x,
entity.size.y);
Math.floor(entity.bounds.left - camera.pos.x) + .5,
Math.floor(entity.bounds.top - camera.pos.y) + .5,
entity.size.x - 1,
entity.size.y -1);
context.stroke();
});
};
Expand All @@ -29,9 +29,10 @@ function createTileCandidateLayer(tileResolver) {
resolvedTiles.forEach(({x, y}) => {
context.beginPath();
context.rect(
x * tileSize - camera.pos.x,
y * tileSize - camera.pos.y,
tileSize, tileSize);
Math.floor(x * tileSize - camera.pos.x) + .5,
Math.floor(y * tileSize - camera.pos.y) + .5,
tileSize - 1,
tileSize - 1);
context.stroke();
});

Expand Down
2 changes: 1 addition & 1 deletion public/js/layers/player-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function createPlayerProgressLayer(font, level) {
const player = entity.traits.get(Player);
font.print('WORLD ' + level.name, context, size * 12, size * 12);

font.print( ' + player.lives.toString().padStart(3, ' '),
font.print('×' + player.lives.toString().padStart(3, ' '),
context, size * 16, size * 16);

spriteBufferContext.clearRect(0, 0,
Expand Down

0 comments on commit a24a4a4

Please sign in to comment.