Camera implemented.

This commit is contained in:
Mal
2020-02-09 22:06:59 +01:00
parent d43cd56d65
commit f6890eec24
8 changed files with 116 additions and 23 deletions

View File

@@ -42,7 +42,7 @@ export default class RetroAnimation extends RetroSprite
}
}
draw(context)
draw(context, camera)
{
if (!this.isPlaying) {
this.currentFrame = 0;
@@ -54,8 +54,8 @@ export default class RetroAnimation extends RetroSprite
0,
this.frameWidth,
this.canvas.height,
this.position.x,
this.position.y,
this.position.x - camera.position.x,
this.position.y - camera.position.y,
this.frameWidth,
this.canvas.height
);