This code snippet positions the moving-platforms (the ones that move left-right).
for( var i = 0; i < this._movingPlatforms.length; i++ ){ var child = this._movingPlatforms[i]; child.x = child.x + child.velocityX; if( child.x <= 0 ){ child.x = 0; child.velocityX = MOVING_PLATFORM_SPEED; }else if( child.x >= 640 - PLATFORM_WIDTH ){ child.x = 640 - PLATFORM_WIDTH; child.velocityX = -MOVING_PLATFORM_SPEED; } }
