mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Gravity and ground height.
This commit is contained in:
@@ -46,6 +46,21 @@ export default class RetroSprite
|
||||
return this.canvas.height;
|
||||
}
|
||||
|
||||
getFootHeight()
|
||||
{
|
||||
return new GeometryPoint(this.position.x, this.position.y + this.getHeight());
|
||||
}
|
||||
|
||||
getPositionLeftFoot()
|
||||
{
|
||||
return new GeometryPoint(this.position.x - this.getWidth() * 0.5, this.position.y);
|
||||
}
|
||||
|
||||
getPositionRightFoot()
|
||||
{
|
||||
return new GeometryPoint(this.position.x + this.getWidth() * 0.5, this.position.y);
|
||||
}
|
||||
|
||||
draw(context)
|
||||
{
|
||||
context.drawImage(this.canvas, this.position.x, this.position.y);
|
||||
|
||||
Reference in New Issue
Block a user