Skip to content

Commit

Permalink
Fixed microbe placement
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrutherford authored Jun 28, 2024
1 parent 258b19c commit b67a4a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion game.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ document.addEventListener('DOMContentLoaded', () => {
const microbe = document.getElementById(selectedMicrobeType).cloneNode(true);
microbe.classList.replace('microbe', 'dish-microbe');
microbe.style.left = `${event.clientX - petriDish.offsetLeft - 10}px`;
microbe.style.top = `${event.clientY}px`;
microbe.style.top = `${event.clientY - petriDish.offsetTop - 10}px`;
microbe.setAttribute('draggable', false);
petriDish.appendChild(microbe);
addBehavior(microbe);
startLifespanTimer(microbe);
updateMicrobeStatistics();
}


function clearAllMicrobes() {
document.querySelectorAll('.dish-microbe').forEach(microbe => microbe.remove());
Expand Down

0 comments on commit b67a4a6

Please sign in to comment.