Calculator Tools Calculator Tools
Create

Arrow Clicker Game

Nov 25, 2023

About this app

Click the up arrow and collect points, then enjoy the Roblox logo rain for bonus points!

Arrow Clicker Game Points: 0 Timer: 15

Related apps

Put this on your site

Source

                    <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Arrow Clicker Game</title>
<meta name="description" content="Click the up arrow and collect points, then enjoy the Roblox logo rain for bonus points!">
<meta name="keywords" content="arrow, clicker, game, Roblox, points, timer">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">

<script type="text/javascript">
// Storage management
const saveLocal = (key, value) => localStorage.setItem(key, JSON.stringify(value));
const loadLocal = key => JSON.parse(localStorage.getItem(key));

// App Javascript Starts
let points = 0;
let timer = 15;
let robloxTimer = null;
let mainTimer = null;

// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
const pointDisplay = document.getElementById("points");
const arrowButton = document.getElementById("arrow-btn");
const timerDisplay = document.getElementById("timer");

function updatePoints() {
pointDisplay.textContent = `Points: ${points}`;
saveLocal('points', points);
}

function updateTimer() {
timerDisplay.textContent = `Timer: ${timer}`;
}

function startRobloxRain() {
for (let i = 0; i < 10; i++) {
const robloxLogo = document.createElement('div');
robloxLogo.classList.add('roblox-logo');
robloxLogo.innerHTML = `<i class="fa fa-free-code-camp" aria-hidden="true"></i>`;
robloxLogo.style.left = `${Math.random() * 100}vw`;
robloxLogo.style.animationDuration = `${Math.random() * 3 + 2}s`;
document.body.appendChild(robloxLogo);

robloxLogo.addEventListener('click', () => {
points += 10; // Graham points
robloxLogo.remove();
updatePoints();
});
}

setTimeout(() => {
document.querySelectorAll('.roblox-logo').forEach(logo => logo.remove());
}, 15000);
}

function startGame() {
points = loadLocal('points') || 0;
updatePoints();
updateTimer();

mainTimer = setInterval(() => {
timer--;
updateTimer();

if (timer <= 0) {
clearInterval(mainTimer);
startRobloxRain();
timer = 15;
updateTimer();
mainTimer = setInterval(() => {
timer--;
updateTimer();
if (timer <= 0) {
clearInterval(mainTimer);
}
}, 1000);
}
}, 1000);
}

arrowButton.addEventListener('click', () => {
points++;
updatePoints();
});

startGame();
});
</script>

<style>
body {
font-family: 'Press Start 2P', cursive;
background: #f0f0f0;
overflow: hidden;
}
#main-container {
text-align: center;
padding-top: 50px;
}
#arrow-btn {
font-size: 4em;
cursor: pointer;
transition: transform 0.1s;
}
#arrow-btn:active {
transform: scale(0.9);
}
.roblox-logo {
position: fixed;
top: -50px;
cursor: pointer;
font-size: 3em;
color: red;
text-shadow: 0 0 10px #ff0000;
animation: fall 5s linear infinite;
}
@keyframes fall {
to {
top: 100vh;
}
}
</style>
</head>
<body>
<div id="main-container" class="container">
<div id="points">Points: 0</div>
<div id="timer">Timer: 15</div>
<div id="arrow-btn"><i class="fa fa-arrow-up" aria-hidden="true"></i></div>
</div>
</body>
</html>