Source:
<code>protected void update(float percent) { <START> sprite.look.updateLookIfSizeIsZero(); <END> float width = sprite.look.getWidthInUserInterfaceDimensionUnit(); float height = sprite.look.getHeightInUserInterfaceDimensionUnit(); float xPosition = sprite.look.getXInUserInterfaceDimensionUnit(); float yPosition = sprite.look.getYInUserInterfaceDimensionUnit(); int halfVirtualScreenWidth = ProjectManager.getInstance().getCurrentProject().getXmlHeader().virtualScreenWidth / 2; int halfVirtualScreenHeight = ProjectManager.getInstance().getCurrentProject().getXmlHeader().virtualScreenHeight / 2; float newDirection = sprite.look.getDirectionInUserInterfaceDimensionUnit(); if (xPosition < -halfVirtualScreenWidth + width / 2) { if (isLookingLeft(newDirection)) { newDirection = -newDirection; fireBounceEvent(); } xPosition = -halfVirtualScreenWidth + (width / 2); } else if (xPosition > halfVirtualScreenWidth - width / 2) { if (isLookingRight(newDirection)) { newDirection = -newDirection; fireBounceEvent(); } xPosition = halfVirtualScreenWidth - (width / 2); } if (yPosition < -halfVirtualScreenHeight + height / 2) { if (isLookingDown(newDirection)) { newDirection = 180f - newDirection; fireBounceEvent(); } yPosition = -halfVirtualScreenHeight + (height / 2); } else if (yPosition > halfVirtualScreenHeight - height / 2) { if (isLookingUp(newDirection)) { newDirection = 180f - newDirection; fireBounceEvent(); } yPosition = halfVirtualScreenHeight - (height / 2); } sprite.look.setDirectionInUserInterfaceDimensionUnit(newDirection); sprite.look.setPositionInUserInterfaceDimensionUnit(xPosition, yPosition); }</code><technical_language>Please handle this in Look.setLookData(...)</technical_language>

Target:
protected void update(float percent) { float width = sprite.look.getWidthInUserInterfaceDimensionUnit(); float height = sprite.look.getHeightInUserInterfaceDimensionUnit(); float xPosition = sprite.look.getXInUserInterfaceDimensionUnit(); float yPosition = sprite.look.getYInUserInterfaceDimensionUnit(); int halfVirtualScreenWidth = ProjectManager.getInstance().getCurrentProject().getXmlHeader().virtualScreenWidth / 2; int halfVirtualScreenHeight = ProjectManager.getInstance().getCurrentProject().getXmlHeader().virtualScreenHeight / 2; float newDirection = sprite.look.getDirectionInUserInterfaceDimensionUnit(); if (xPosition < -halfVirtualScreenWidth + width / 2) { if (isLookingLeft(newDirection)) { newDirection = -newDirection; fireBounceEvent(); } xPosition = -halfVirtualScreenWidth + (width / 2); } else if (xPosition > halfVirtualScreenWidth - width / 2) { if (isLookingRight(newDirection)) { newDirection = -newDirection; fireBounceEvent(); } xPosition = halfVirtualScreenWidth - (width / 2); } if (yPosition < -halfVirtualScreenHeight + height / 2) { if (isLookingDown(newDirection)) { newDirection = 180f - newDirection; fireBounceEvent(); } yPosition = -halfVirtualScreenHeight + (height / 2); } else if (yPosition > halfVirtualScreenHeight - height / 2) { if (isLookingUp(newDirection)) { newDirection = 180f - newDirection; fireBounceEvent(); } yPosition = halfVirtualScreenHeight - (height / 2); } sprite.look.setDirectionInUserInterfaceDimensionUnit(newDirection); sprite.look.setPositionInUserInterfaceDimensionUnit(xPosition, yPosition); }