Skip to content

Commit

Permalink
Create Mario army for fun.
Browse files Browse the repository at this point in the history
  • Loading branch information
pomle committed Sep 23, 2017
1 parent 2a9862b commit 9228921
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const context = canvas.getContext('2d');

function createSpriteLayer(sprite, pos) {
return function drawSpriteLayer(context) {
sprite.draw('idle', context, pos.x, pos.y);
for (let i = 0; i < 20; ++i) {
sprite.draw('idle', context, pos.x + i * 16, pos.y);
}
};
}

Expand All @@ -26,8 +28,8 @@ Promise.all([
comp.layers.push(createBackgroundLayer(level.backgrounds, backgroundSprites));

const pos = {
x: 64,
y: 64,
x: 0,
y: 0,
};

comp.layers.push(createSpriteLayer(marioSprite, pos));
Expand Down

0 comments on commit 9228921

Please sign in to comment.