Arcade Hub
by SilverFalcon8784 lines2.9 KB
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Arcade Hub</title>
<style>
body { margin: 0; background: #111; font-family: Arial, sans-serif; overflow: hidden; }
canvas { display: block; margin: auto; background: #222; }
.overlay {
position: absolute; top: 50%; left: 50%;
transform: translate(-50%, -50%);
background: rgba(51,51,51,0.95); padding: 20px; border-radius: 10px;
color: white; text-align: center; width: 300px;
}
button {
background: #555; color: white; padding: 10px 20px;
border: none; margin: 5px; cursor: pointer;
font-size: 16px; border-radius: 5px;
}
button:hover { background: #777; }
h1, h2 { margin-top: 0; }
</style>
</head>
<body>
<canvas id="gameCanvas" width="400" height="600"></canvas>
<!-- Menu -->
<div id="menu" class="overlay">
<h1 id="title">🎮 Arcade Hub 🎮</h1>
<button onclick="startGame('catch')">Catch Objects</button>
<button onclick="startGame('flappy')">Flappy Bird Clone</button>
<button onclick="startGame('savehouse')">Save People from Zombies</button>
<button onclick="showSettings()">Settings</button>
<button onclick="showHelp()">Help</button>
</div>
<!-- Settings -->
<div id="settings" class="overlay" style="display:none;">
<h2>Settings</h2>
<button onclick="toggleSound()">Toggle Sound: <span id='soundStatus'>On</span></button>
<button onclick="setDifficulty('easy')">Easy</button>
<button onclick="setDifficulty('medium')">Medium</button>
<button onclick="setDifficulty('hard')">Hard</button>
<button onclick="backToMenu()">Back</button>
</div>
<!-- Help -->
<div id="help" class="overlay" style="display:none;">
<h2>Help</h2>
<p>Use arrow keys or mouse to control games.
Catch falling objects, flap to avoid pipes, or rescue people from zombies.
In zombie mode, collect tools to attack and protect survivors.</p>
<button onclick="backToMenu()">Back</button>
</div>
<!-- Restart -->
<div id="restart" class="overlay" style="display:none;">
<h2>Game Over</h2>
<p id="finalScore"></p>
<button onclick="restartGame()">Restart</button>
<button onclick="backToMenu()">Main Menu</button>
</div>
<script>
const canvas = document.getElementById("gameCanvas");
const ctx = canvas.getContext("2d");
let currentGame = null;
let soundOn = true;
let difficulty = "medium";
let score = 0;
let gameOver = false;
// Sound effects
const catchSound = new Audio("https://actions.google.com/sounds/v1/cartoon/clang_and_wobble.ogg");
const gameOverSound = new Audio("https://actions.google.com/sounds/v1/cartoon/wood_plank_flicks.ogg");
const flapSound = new Audio("https://actions.google.com/sounds/v1/cartoon/slide_whistle.ogg");
const zombieAttackSound = new Audio("https://actions.google.com/sounds/v1/foley/punch.ogg");
const toolPickupSound = new Audio("https://actions.google.com/sounds/v1/cartoon/pop.ogg");
// Menu functions
Game Source: Arcade Hub
Creator: SilverFalcon87
Libraries: none
Complexity: moderate (84 lines, 2.9 KB)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: arcade-hub-silverfalcon87" to link back to the original. Then publish at arcadelab.ai/publish.