|
|
@@ -698,12 +698,6 @@ function doPowerup() { |
|
|
button.style.setProperty("--lifetime", lifetime/1000 + "s"); |
|
|
button.style.setProperty("--lifetime", lifetime/1000 + "s"); |
|
|
button.style.setProperty("--leftpos", left); |
|
|
button.style.setProperty("--leftpos", left); |
|
|
button.style.setProperty("--toppos", top); |
|
|
button.style.setProperty("--toppos", top); |
|
|
const icon = document.createElement("div"); |
|
|
|
|
|
|
|
|
|
|
|
icon.classList.add("fas"); |
|
|
|
|
|
icon.classList.add("fa-drumstick-bite"); |
|
|
|
|
|
|
|
|
|
|
|
button.appendChild(icon); |
|
|
|
|
|
|
|
|
|
|
|
const body = document.querySelector("body"); |
|
|
const body = document.querySelector("body"); |
|
|
|
|
|
|
|
|
@@ -718,6 +712,13 @@ function doPowerup() { |
|
|
const choice = Math.floor(Math.random() * choices.length); |
|
|
const choice = Math.floor(Math.random() * choices.length); |
|
|
|
|
|
|
|
|
const powerup = powerups[choices[choice]]; |
|
|
const powerup = powerups[choices[choice]]; |
|
|
|
|
|
|
|
|
|
|
|
const icon = document.createElement("div"); |
|
|
|
|
|
|
|
|
|
|
|
icon.classList.add("fas"); |
|
|
|
|
|
icon.classList.add(powerup.icon); |
|
|
|
|
|
|
|
|
|
|
|
button.appendChild(icon); |
|
|
|
|
|
|
|
|
const remove = setTimeout(() => { |
|
|
const remove = setTimeout(() => { |
|
|
body.removeChild(button); |
|
|
body.removeChild(button); |
|
|
|