UğurcanEser
WorkScrap Baron

Scrap Baron

A pixel-art scrapyard tycoon game for phones and the browser

Overview

Scrap Baron is a portrait, pixel-art tycoon game set in the scrap trade of Istanbul’s outer industrial districts. Street collectors bring sacks of copper, iron, cardboard and plastic to your gate. You weigh, inspect and haggle, then sell the stock on to wholesalers and grow a small neighbourhood yard into a recycling plant.

It runs in the browser as an installable web app, and as native iOS and Android apps. The browser version is playable now, and the mobile versions are being prepared for release on the App Store and Google Play. The game is free, with no purchases, ads, accounts or analytics. It is available in Turkish and English.

The scrapyard at the start of a day Haggling with a collector at the scale Catching water-soaked cardboard The recycling plant

Gameplay

  • A day in four phases: set your buying prices in the morning, serve the queue at the scale during the day, sell to wholesalers and pay the bills in the evening, then read the day’s report.
  • Ten-second decisions: weigh each sack, inspect it and make an offer in up to two rounds of haggling while the rest of the queue loses patience.
  • Fraud to catch: wet cardboard, stones hidden in sacks and mixed metals. You catch them by looking closely, using a magnet or tipping the sack out.
  • Running a business: equipment, staff, cooperative loans and cheques, tonnage contracts that can bounce, a licence, neighbour complaints, municipal inspections and rival price wars.
  • Three tiers: a neighbourhood yard, a sorting plant and a recycling plant with a furnace, a granule line, exports and municipal tenders. The last tier ends with the Scrap Baron title and then opens an endless mode.
  • Extras: 25 achievements, 18 cosmetics for the yard, and a scripted first day with a mentor character.

How it’s built

  • No game engine. The scene is drawn with Canvas 2D into a buffer at game resolution and scaled up by a whole number, so pixels stay sharp. All art is painted in code, and the interface is HTML with pixel-art frames. The game is about 160 KB gzipped.
  • Deterministic simulation. The simulation never touches the DOM, timers, the clock or Math.random. It uses a seeded random number generator whose state is saved, so a restored save continues exactly where it left off. Money, weight and time are stored as integers.
  • Synthesized audio. Every sound is generated with the Web Audio API, with no audio files.
  • Saves without a server. The game autosaves on the device, and a compressed save code moves a game between devices.
  • Battery friendly. Rendering is capped at 30 frames per second, which is enough for pixel art.
  • Enforced layers. ESLint rules keep the simulation, art and core code independent of the interface layers.
  • Tooling. Bots play many seeded games to check the balance, and Playwright drives the real game to generate the store screenshots.

Stack

  • TypeScript, Vite, Canvas 2D, Web Audio API
  • Installable web app (PWA) with offline support, served on Cloudflare Workers
  • Capacitor for the iOS and Android apps

Quality

  • About 330 Vitest unit tests and a Playwright suite of 28 end-to-end tests in a phone-sized viewport
  • GitHub Actions CI checks commit messages, formatting, linting and types, runs the unit tests and builds the game

What’s next?

All work