mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Terrain collision.
This commit is contained in:
@@ -40,6 +40,16 @@ export default class Movable
|
||||
return this.animations[this.currentAnimation].getRect();
|
||||
}
|
||||
|
||||
getWidth()
|
||||
{
|
||||
return this.getRect().width;
|
||||
}
|
||||
|
||||
getHeight()
|
||||
{
|
||||
return this.getRect().height;
|
||||
}
|
||||
|
||||
getPositionFootLeft()
|
||||
{
|
||||
return new GeometryPoint(
|
||||
@@ -50,7 +60,23 @@ export default class Movable
|
||||
getPositionFootRight()
|
||||
{
|
||||
return new GeometryPoint(
|
||||
this.position.x + this.animations[this.currentAnimation].getWidth() * 0.5, this.position.y
|
||||
this.position.x + this.getWidth() * 0.5, this.position.y
|
||||
);
|
||||
}
|
||||
|
||||
getPositionHeadLeft()
|
||||
{
|
||||
return new GeometryPoint(
|
||||
this.position.x - this.animations[this.currentAnimation].getWidth() * 0.5,
|
||||
this.position.y - this.animations[this.currentAnimation].getHeight()
|
||||
);
|
||||
}
|
||||
|
||||
getPositionHeadRight()
|
||||
{
|
||||
return new GeometryPoint(
|
||||
this.position.x + this.getWidth() * 0.5,
|
||||
this.position.y - this.animations[this.currentAnimation].getHeight()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user