How Browser Truck Simulator Games Work
A browser truck game is a web page running a small program. Here is how ours works, in plain terms.
The drawing and the loop
The game draws the road, truck and traffic on an HTML canvas. A loop driven by the browser's animation timing updates positions and redraws roughly once per screen refresh.
Input, collisions and saving
Keyboard and touch events set simple on/off flags. Collisions are checked by comparing rectangles around the truck and vehicles. Your best score is stored in the browser's local storage, which stays on your device.
Frequently asked questions
Does the game load anything from other sites?
No. It uses one small script and one stylesheet from this site, with no libraries or trackers.