Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SpiderMkey authored Oct 18, 2024
0 parents commit 5471924
Showing 1 changed file with 175 additions and 0 deletions.
175 changes: 175 additions & 0 deletions shiney rock clicker.09.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shiny Rock Miner</title>
<style>
body {
display: flex;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
background-image: url('https://i.ytimg.com/vi/ZqFwlWu4MLk/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGEkgGSh_MA8=&rs=AOn4CLBZHi7uK08SYl6uVgE-mDragz0Hhg'); /* Add your background image URL here */
background-size: cover; /* Cover the entire background */
background-position: center; /* Center the background */
}
#sidebar {
width: 350px; /* Set sidebar width to 350 pixels */
background-color: rgba(0, 123, 255, 0.8); /* Semi-transparent blue background */
color: white; /* Text color in sidebar */
padding: 20px;
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5); /* Optional shadow for effect */
}
#main {
display: flex;
flex-direction: column;
align-items: center;
flex: 1; /* Take up remaining space */
}
#rock { width: 500px; cursor: pointer; } /* Set image size to 500 pixels */
#message { color: red; font-weight: bold; margin-top: 20px; display: none; }
h1 { color: purple; } /* Title color */
button {
width: 100%; /* Make buttons full width */
padding: 15px; /* Increased padding for larger buttons */
font-size: 16px; /* Increased font size for better readability */
margin: 5px 0; /* Margin between buttons */
cursor: pointer;
}
</style>
</head>
<body>
<div id="sidebar">
<h2>Shiny Rocks: <span id="rockCount">0</span></h2>
<button id="upgradeButton">Upgrade Click (Cost: 10 shiny rocks) - Upgrades: <span id="upgradeCount">0</span></button> <!-- Upgrade count -->
<button id="autoClickerButton">Buy Auto Miner (Cost: 50 shiny rocks) - Auto Miners: <span id="autoMinerCount">0</span></button> <!-- Auto miner count -->
<button id="minigameButton">Play a Minigame (Cost: 100 shiny rocks) - Minigames: <span id="minigameCount">0</span></button> <!-- Minigame count -->
<button id="playGameButton">Playing the Game (Cost: 200 shiny rocks) - Games: <span id="playGameCount">0</span></button> <!-- New play game button -->
<div id="message"></div>
</div>

<div id="main">
<h1>Shiny Rock Miner</h1>
<h2>Shiny Rocks: <span id="rockCountAbove">0</span></h2> <!-- Display above the image -->
<img id="rock" src="http://clipart-library.com/newhp/crystal-drawing-mineral-quartz-amethyst-crystal.jpg" alt="Shiny Rock">
<h3>Auto Miner Output: <span id="autoClickerOutput">0</span> shiny rocks per second</h3> <!-- Moved below the image -->
</div>

<script>
let rockCount = 0;
let upgradeCost = 10;
let autoMinerCost = 50;
let minigameCost = 100; // Initial cost for the minigame upgrade
let playGameCost = 200; // Initial cost for the Playing the Game upgrade
let clickValue = 1;
let autoMinerValue = 0;
let autoMinerActive = false;
let minigameActive = false; // Track minigame activation
let playGameActive = false; // Track Playing the Game activation

// Counters for upgrades
let upgradeCount = 0;
let autoMinerCount = 0;
let minigameCount = 0;
let playGameCount = 0;

document.getElementById("rock").addEventListener("click", () => {
rockCount += clickValue;
updateRockCount();
});

document.getElementById("upgradeButton").addEventListener("click", () => {
if (rockCount >= upgradeCost) {
rockCount -= upgradeCost;
clickValue += 1;
upgradeCost = Math.floor(upgradeCost * 1.3); // Increase the cost for the next upgrade by 1.3
upgradeCount++; // Increment upgrade count
updateRockCount();
document.getElementById("upgradeButton").innerText = `Upgrade Click (Cost: ${upgradeCost} shiny rocks) - Upgrades: ${upgradeCount}`;
} else {
showMessage("Not enough shiny rocks!");
}
});

document.getElementById("autoClickerButton").addEventListener("click", () => {
if (rockCount >= autoMinerCost) {
rockCount -= autoMinerCost;
autoMinerValue += 1;
autoMinerCount++; // Increment auto miner count
autoMinerCost = Math.floor(autoMinerCost * 1.3); // Increase the cost for the next auto miner by 1.3
updateRockCount();
document.getElementById("autoClickerOutput").innerText = autoMinerValue;
document.getElementById("autoClickerButton").innerText = `Buy Auto Miner (Cost: ${autoMinerCost} shiny rocks) - Auto Miners: ${autoMinerCount}`;

if (!autoMinerActive) {
autoMinerActive = true;
setInterval(() => {
rockCount += autoMinerValue;
updateRockCount();
}, 1000); // Auto miner triggers every second
}
} else {
showMessage("Not enough shiny rocks!");
}
});

document.getElementById("minigameButton").addEventListener("click", () => {
if (rockCount >= minigameCost) {
rockCount -= minigameCost;
minigameActive = true;
minigameCount++; // Increment minigame count
updateRockCount();

// Start the minigame interval to add shiny rocks
setInterval(() => {
if (minigameActive) {
rockCount += 5; // Add 5 shiny rocks every 2 seconds
updateRockCount();
}
}, 2000); // Minigame triggers every 2 seconds

// Update the cost for the next minigame purchase
minigameCost = Math.floor(minigameCost * 1.3); // Increase the cost for the next time
document.getElementById("minigameButton").innerText = `Play a Minigame (Cost: ${minigameCost} shiny rocks) - Minigames: ${minigameCount}`;
} else {
showMessage("Not enough shiny rocks!");
}
});

document.getElementById("playGameButton").addEventListener("click", () => {
if (rockCount >= playGameCost) {
rockCount -= playGameCost;
playGameCount++; // Increment play game count
updateRockCount();

// Start adding shiny rocks every 2 seconds
setInterval(() => {
rockCount += 8; // Add 8 shiny rocks every 2 seconds
updateRockCount();
}, 2000); // Playing the Game triggers every 2 seconds

// Update the cost for the next play game purchase
playGameCost = Math.floor(playGameCost * 1.3); // Increase the cost for the next time
document.getElementById("playGameButton").innerText = `Playing the Game (Cost: ${playGameCost} shiny rocks) - Games: ${playGameCount}`;
} else {
showMessage("Not enough shiny rocks!");
}
});

function updateRockCount() {
document.getElementById("rockCount").innerText = rockCount;
document.getElementById("rockCountAbove").innerText = rockCount; // Update the count above the image
}

function showMessage(message) {
const messageDiv = document.getElementById("message");
messageDiv.innerText = message;
messageDiv.style.display = "block";
setTimeout(() => {
messageDiv.style.display = "none";
}, 3000); // Message disappears after 3 seconds
}
</script>
</body>
</html>

0 comments on commit 5471924

Please sign in to comment.