Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case DIRECTION_Y:
- if (oldTileX != newTileX) {
- if (this._isSurface(scene, newTileX, oldTileY)) {
- pos.tileX = newTileX;
- pos.tileY = oldTileY;
- pos.sceneX = Math.floor(startPosX / WALL_SIZE) * WALL_SIZE;
- if (xDifference >= 0) {
- pos.sceneX += WALL_SIZE;
- pos.side = SIDE_LEFT;
- }
- else {
- pos.side = SIDE_RIGHT;
- }
- pos.sceneY = this._getEndPosA(controlSizeY, controlSizeX, this._raySourcePosition.y, this._raySourcePosition.x, pos.sceneX);
- surfaceEarned = true;
- }
- }
- else {
- if (this._isSurface(scene, newTileX, newTileY)) {
- pos.tileX = newTileX;
- pos.tileY = newTileY;
- pos.sceneX = endPosX;
- pos.sceneY = endPosY;
- pos.side = yDifference >= 0 ? SIDE_UP : SIDE_DOWN;
- surfaceEarned = true;
- }
- }
- break;
- default:
- return undefined;
- }//*/
- return (surfaceEarned ? pos : undefined);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement