Skip to content

Case study · Tuwaiq Academy

Piece By Piece

A Breakout-style game in plain JavaScript, with sign-up, a leaderboard and a Saudi National Day edition.

My role
Design and code
Team
Solo
Timeline
Sep 2024, 5 days
Context
Tuwaiq Academy
Platform
Web game on GitHub Pages
The home page on a desktop browser and a phone: "Unleash the Fun With" beside the red, blue and yellow Piece By Piece logo
Fig. 01 · Home on desktop and phone

01 Overview

Piece By Piece is a small games site. Its first game is Breakout: move the paddle to bounce the ball and break the bricks. Players register to save their scores to a leaderboard, and a National Day edition themes the game for Saudi National Day.

02 Problem

A Tuwaiq Academy exercise in plain JavaScript: no framework, so the game loop, the collisions and the state are all written by hand.

03 My role

  • GameWrote the game as classes: Ball, Paddle, Brick, BrickWall and Settings
  • PagesBuilt the home, game, register and about pages
  • ScoresSaved players and scores through MockAPI
  • DesignDesigned the logo and the National Day theme
Game
JavaScriptHTMLCSS
Build and data
ViteMockAPI
Hosting
GitHub Pages

04 Key decisions

A class per game object

What we chose

Plain JavaScript classes for the ball, the paddle, the bricks, the wall and the settings

Why

Each object owns its position and drawing, so the game loop stays short.

Trade-off

Collisions and the game state are all written by hand.

Leaderboard on MockAPI

What we chose

MockAPI for players and their scores

Why

A shared leaderboard without writing a server.

Trade-off

The data is public, so anyone with the URL could edit a score.

05 Result

Live on GitHub Pages since September 2024, in time for Saudi National Day 94.

The games section: Breakout with a Try Out button, and Jigsaw marked Coming Soon
01 / 03
Fig. 02 · Breakout and Jigsaw

What I learned

Writing a game without a framework taught me object-oriented programming, the physics of a bouncing ball and how to shape the game experience.

With thanks to

Next project: Messgestix

A two-phone chat demo in React: name two users, then send messages and emoji between the screens.

Questions

Want to Go Deeper on Piece By Piece? I’m Happy to Walk You Through It.

Email me