How Browser Games Work: HTML5, Canvas, Audio and Local Storage
A practical explanation of what happens when an OnTrick game loads in your browser and why modern HTML5 games need no installation.
Browser games are real applications
A modern browser game is more than a picture with buttons. The browser downloads HTML, CSS and JavaScript, then runs the game logic on your device. That means many simple arcade and puzzle games can start almost immediately without an installer, an app store account or a separate launcher.
The role of HTML5
HTML provides the page structure, while CSS controls layout and presentation. JavaScript handles movement, scoring, timers, collisions and input. Canvas is a browser drawing surface that games can update many times per second, which makes it useful for titles such as racers, shooters, pong-style games and endless runners.
Why some games use normal page elements
Not every game needs Canvas. Memory cards, word games, number puzzles and board games can be built from standard buttons and grid elements. This can make them easier to scale for different screen sizes and easier for assistive technologies to interpret.
Sound without audio files
A browser can generate simple tones through the Web Audio API. OnTrick uses a shared sound system for lightweight effects such as clicks, score cues and win or lose feedback. The browser normally requires a real user interaction before audio starts, so sound begins after the first click, tap or key press.
Saving small preferences
Local storage is a browser feature that can remember small pieces of information on the same device. OnTrick can use it for convenience features such as favourites and sound volume. Clearing browser site data removes those local settings.
Performance and privacy
Because these games are lightweight, much of the gameplay can happen directly on the visitor's device. Server logs may still record normal website requests, and advertising or analytics services can add their own processing when enabled. The Privacy Policy explains the site's current approach in more detail.