diff --git a/index.html b/index.html
index 71b02d6..d3d9500 100644
--- a/index.html
+++ b/index.html
@@ -20,6 +20,7 @@
+
diff --git a/js/input.js b/js/input.js
index 20d277e..4bb4c69 100644
--- a/js/input.js
+++ b/js/input.js
@@ -28,6 +28,8 @@ function setTool(tool) {
document.getElementById('fire-btn').classList.add('active');
} else if (tool === LAVA) {
document.getElementById('lava-btn').classList.add('active');
+ } else if (tool === RABBIT) {
+ document.getElementById('rabbit-btn').classList.add('active');
} else if (tool === EMPTY) {
document.getElementById('eraser-btn').classList.add('active');
}
@@ -114,6 +116,20 @@ function draw(x, y) {
colorIndex: Math.floor(Math.random() * FIRE_COLORS.length)
});
}
+ }
+ // Special handling for rabbits - only spawn on empty spaces
+ else if (currentTool === RABBIT) {
+ if (getPixel(pixelX, pixelY) === EMPTY) {
+ setPixel(pixelX, pixelY, RABBIT);
+ // Initialize rabbit metadata
+ setMetadata(pixelX, pixelY, {
+ initialized: true,
+ jumpCooldown: 0,
+ direction: Math.random() > 0.5 ? 1 : -1, // 1 for right, -1 for left
+ jumpHeight: 0,
+ colorIndex: Math.floor(Math.random() * RABBIT_COLORS.length)
+ });
+ }
} else {
setPixel(pixelX, pixelY, currentTool);