Speedy Game
About this app
Speedy Game - A fast-paced and addictive game
Speedy Game Speedy Game 0 Click Me Game Over Play Again Start Game
Related apps
Put this on your site
Source
<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>Speedy Game</title>
<meta name="description" content="Speedy Game - A fast-paced and addictive game">
<meta name="keywords" content="speedy, game, fast-paced, addictive">
<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://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
$(document).ready(function() {
var score = 0;
var timer;
// Start the game
function startGame() {
score = 0;
$("#score").text(score);
$(".game-over").hide();
// Set up timer
timer = setInterval(function() {
score++;
$("#score").text(score);
}, 1000);
}
// Game over
function gameOver() {
clearInterval(timer);
$(".game-over").show();
}
// Event listener for clicking on the target
$(".target").click(function() {
score++;
$("#score").text(score);
});
// Event listener for clicking the start button
$("#start-button").click(function() {
startGame();
});
// Event listener for clicking the game over button
$("#game-over-button").click(function() {
startGame();
});
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
/* App CSS Goes Here */
body {
background-color: #f8f9fa;
font-family: 'Press Start 2P', cursive;
}
#main-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
h1 {
color: #343a40;
margin-bottom: 2rem;
text-align: center;
}
.game-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
padding: 2rem;
border-radius: 10px;
box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.1);
}
#score {
font-size: 3rem;
color: #343a40;
margin-bottom: 2rem;
}
.target {
margin-bottom: 1rem;
width: 100px;
height: 100px;
background-color: #007bff;
color: #fff;
font-size: 2rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.target:hover {
background-color: #0056b3;
}
.game-over {
display: none;
text-align: center;
margin-top: 2rem;
}
.game-over-title {
color: #dc3545;
font-size: 2rem;
margin-bottom: 1rem;
}
#game-over-button {
padding: 0.5rem 1rem;
background-color: #dc3545;
color: #fff;
border: none;
border-radius: 5px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
#game-over-button:hover {
background-color: #b02a38;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Speedy Game</h1>
<div class="game-container">
<div id="score">0</div>
<div class="target">Click Me</div>
<div class="game-over">
<div class="game-over-title">Game Over</div>
<button id="game-over-button">Play Again</button>
</div>
</div>
<button id="start-button">Start Game</button>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!