|  |  | @@ -28,11 +28,18 @@ function tickPowerups(delta) { | 
		
	
		
			
			|  |  |  | for (let i = activePowerups.length-1; i >= 0; i--) { | 
		
	
		
			
			|  |  |  | activePowerups[i].lifetime -= delta; | 
		
	
		
			
			|  |  |  | if (activePowerups[i].lifetime <= 0) { | 
		
	
		
			
			|  |  |  | clickPopup("OOF", "info", [500, 500]); | 
		
	
		
			
			|  |  |  | powerupList.removeChild(activePowerups[i].element); | 
		
	
		
			
			|  |  |  | const entry = activePowerups[i]; | 
		
	
		
			
			|  |  |  | setTimeout(() => { | 
		
	
		
			
			|  |  |  | powerupList.removeChild(entry.element); | 
		
	
		
			
			|  |  |  | }, 1000); | 
		
	
		
			
			|  |  |  | entry.element.classList.add("powerup-entry-done"); | 
		
	
		
			
			|  |  |  | activePowerups.splice(i, 1); | 
		
	
		
			
			|  |  |  | changed = true; | 
		
	
		
			
			|  |  |  | } else { | 
		
	
		
			
			|  |  |  | const frac = (activePowerups[i].powerup.duration - activePowerups[i].lifetime) / (activePowerups[i].powerup.duration); | 
		
	
		
			
			|  |  |  | activePowerups[i].element.style.setProperty("--progress", frac * 100 + "%") | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | if (changed) { | 
		
	
	
		
			
				|  |  | @@ -44,13 +51,14 @@ function addPowerup(powerup) { | 
		
	
		
			
			|  |  |  | const powerupList = document.querySelector("#powerup-list"); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | const powerupEntry = document.createElement("div"); | 
		
	
		
			
			|  |  |  | powerupEntry.classList.add("powerup-entry"); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | powerupEntry.innerText = powerup.name; | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | powerupList.appendChild(powerupEntry); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | activePowerups.push({powerup: powerup, lifetime: powerup.duration, element: powerupEntry}); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | updateAll(); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
	
		
			
				|  |  | 
 |