EighteN's picture
ใƒฌใ‚คใ‚ขใ‚ฆใƒˆใฏ่‰ฏใใชใฃใŸใ‘ใฉใ€ใ‚„ใฃใฑใ‚Šใ‚นใƒ”ใƒณใƒœใ‚ฟใƒณใŒๅŠนใ‹ใชใ„ใ‚ˆใ€‚ใ‚ใจ่ค‡ๆ•ฐใฎ็ตตๆŸ„ใŒ้‡ใชใฃใฆ่กจ็คบใ•ใ‚Œใฆใ—ใพใฃใฆใ„ใ‚‹ใ‚ˆใ€‚
25f0ee3 verified
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();
}
}