26.12.2013 Views

user interface design by applying theories of aesthetics - Theseus

user interface design by applying theories of aesthetics - Theseus

user interface design by applying theories of aesthetics - Theseus

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

45<br />

function enterframe(event:Event):void<br />

{<br />

if (targetX < leftBound)<br />

{<br />

threshold = (leftBound - targetX)/100;<br />

leftOfBG = background.x - (background.width/2);<br />

if (leftOfBG < leftEdgeOfStage)<br />

{<br />

background.x +=<br />

threshold*bgSpeed;<br />

}<br />

}<br />

if (targetX > rightBound)<br />

{<br />

threshold = Math.abs((rightBound - targetX)/100);<br />

rightOfBG = background.x +<br />

(background.width/2);<br />

if (rightOfBG > rightEdgeOfStage)<br />

{<br />

background.x -= threshold*bgSpeed;<br />

}<br />

}<br />

Figure 20: Source code <strong>of</strong> moving background

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!