9 lines
		
	
	
		
			241 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
		
			241 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
function nextAnimationFrame(animation){
 | 
						|
    if(animation.frameIndex >= animation.frameLength){
 | 
						|
            animation.frameIndex = 1;
 | 
						|
        }
 | 
						|
        else{
 | 
						|
            animation.frameIndex++;
 | 
						|
        }
 | 
						|
        return animation.frameIndex;
 | 
						|
} |