Spaces:
Running
Running
File size: 1,296 Bytes
5b3ade9 cad8cdf 5b3ade9 cad8cdf 25f0ee3 cad8cdf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
document.addEventListener('DOMContentLoaded', () => {
// Hide loading screen when all components are ready
setTimeout(() => {
document.getElementById('loading').style.opacity = '0';
setTimeout(() => {
document.getElementById('loading').style.display = 'none';
}, 500);
}, 1000);
// Game state
let coins = 10;
let unlockedSymbols = ['π', 'π', 'π'];
const rareSymbols = ['7οΈβ£', 'π°', 'π', 'π'];
const jackpotSymbols = ['π°'];
// Update coin display
function updateCoins() {
document.getElementById('coin-counter').textContent = `Coins: ${coins}`;
}
// Play sound
function playSound(id) {
const sound = document.getElementById(id);
sound.currentTime = 0;
sound.play();
}
// Initialize game
updateCoins();
// Expose functions to components
window.gameState = {
coins,
unlockedSymbols,
rareSymbols,
jackpotSymbols,
updateCoins,
playSound
};
});
// Helper function for components to update game state
function updateGameState(newState) {
Object.assign(window.gameState, newState);
if (window.gameState.updateCoins) {
window.gameState.updateCoins();
}
} |