Loading game...
packages = []
terminal = false
[[fetch]]
files = [
"./puzzle_game_web.py",
"./sounds/place.wav",
"./sounds/line.wav",
"./sounds/combo.wav",
"./sounds/bomb.wav",
"./sounds/explosion.wav"
]
from pyscript import display
from js import document, window
from puzzle_game_web import PuzzleGame, debug_print
import asyncio
async def init_game():
try:
# Initialize audio context
window.AudioContext = window.AudioContext or window.webkitAudioContext
game = PuzzleGame()
# Wait for sounds to load
await game.sound_manager.load_sounds()
game.sounds_loaded = True # Enable game interaction after sounds are loaded
document.getElementById("loading").style.display = "none"
debug_print("Game started successfully")
except Exception as e:
debug_print(f"Error starting game: {e}")
document.getElementById("loading").innerHTML = f"Error loading game: {str(e)}"
# Initialize the game when the page loads
asyncio.create_task(init_game())