Skip to content

Instantly share code, notes, and snippets.

@ilkinulas
Created January 26, 2013 18:38
Show Gist options
  • Save ilkinulas/4643728 to your computer and use it in GitHub Desktop.
Save ilkinulas/4643728 to your computer and use it in GitHub Desktop.
Dedigin gibi sabit bir noktaya gore tum kutularin y koordinatlarini guncelleyince oldu :)
private function onEnterFrame(event:EnterFrameEvent):void {
const distance : Number = event.passedTime * velocity;
const reelHeight : Number = boxSize * boxes.length;
//0 ile reel height arasinda gidip geliyor...
totalDistance = (totalDistance + distance ) % reelHeight;
for (var i:int = 0; i<boxes.length; i++) {
boxes[i].y = (boxStartY + totalDistance + (i * boxSize) ) % reelHeight;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment