mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Camera implemented.
This commit is contained in:
@@ -40,6 +40,14 @@ export default class Movable
|
||||
return this.animations[this.currentAnimation].getRect();
|
||||
}
|
||||
|
||||
getCenter()
|
||||
{
|
||||
return new GeometryPoint(
|
||||
this.position.x + this.getWidth() * 0.5,
|
||||
this.position.y + this.getHeight() * 0.5
|
||||
);
|
||||
}
|
||||
|
||||
getWidth()
|
||||
{
|
||||
return this.getRect().width;
|
||||
@@ -99,9 +107,9 @@ export default class Movable
|
||||
this.position.y = height - this.animations[this.currentAnimation].getHeight();
|
||||
}
|
||||
|
||||
draw(context)
|
||||
draw(context, camera)
|
||||
{
|
||||
this.animations[this.currentAnimation].setFootPosition(this.position.x, this.position.y);
|
||||
this.animations[this.currentAnimation].draw(context);
|
||||
this.animations[this.currentAnimation].draw(context, camera);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user