public boolean tryMove(double dx, double dy) {

		byte ret = this.level.getPhysicHandler().checkCollision(level, this,
				dx, dy);

		if ((ret == WorldPhysicHandler.entityDies)) {
			this.die();
			return false;
		}
		boolean moveUp = false;
		if ((ret & WorldPhysicHandler.allowedMovementHorizontally) == 0) {
			// If the entity isn't allowed to move horizontally, we check, if we
			// simply have to move 1px up.

			this.y -= 1;
			moveUp = (WorldPhysicHandler.allowedMovementHorizontally & level
					.getPhysicHandler().checkCollision(level, this, dx, dy)) != 0;

			if (moveUp) {
				ret = (byte) (WorldPhysicHandler.allowedMovementHorizontally | ret);
				this.ya -= 35;
			} else {
				this.y += 1;
			}
		}

		boolean vertical = true;
		this.onGround = false;
		if ((ret & WorldPhysicHandler.allowedMovementVertically) != 0) {
			this.y += dy;
		} else {
			if (ya >= 0) {
				this.onGround = true;
				if (Math.abs(ya) < 3) {
					ya = 0;
				}
			}

			this.ya = -this.ya * bounce;

			this.y -= dy * bounce;
			vertical = false;
		}
		if (this.y + this.h > this.level.getHeight()) {
			this.ya = 0;
			this.onGround = true;
			vertical = false;
		}

		boolean horizontal = true;
		if ((ret & WorldPhysicHandler.allowedMovementHorizontally) != 0) {
			this.x += dx;
		} else {

			this.xa = -this.xa * bounce;
			this.x -= dx * bounce;
			horizontal = false;
		}

		return vertical && horizontal;
	}