Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean collidesRight() {
- for(float step = 0; step < getHeight(); step += collisionLayer.getTileHeight() / 2)
- if(isCellBlocked(getX() + getWidth(), getY() + step))
- return true;
- return false;
- }
- public boolean collidesLeft() {
- for(float step = 0; step < getHeight(); step += collisionLayer.getTileHeight() / 2)
- if(isCellBlocked(getX(), getY() + step))
- return true;
- return false;
- }
- public boolean collidesTop() {
- for(float step = 0; step < getWidth(); step += collisionLayer.getTileWidth() / 2)
- if(isCellBlocked(getX() + step, getY() + getHeight()))
- return true;
- return false;
- }
- public boolean collidesBottom() {
- for(float step = 0; step < getWidth(); step += collisionLayer.getTileWidth() / 2)
- if(isCellBlocked(getX() + step, getY()))
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement