Skip to the content
PCBKitNew board
2 layers160 × 80 mmAccesibility, the printed circuit board in 3D

This repository contains a physics-driven, multiplayer platformer game built with p5.js and Matter.js, targeting the Grade 11/12 ICS2/3x Programming curriculum. Key features include:

Size
160 × 80 mm
Copper layers
2
Thickness
1.6 mm
Parts
6
Nets
40
Pads
72
Tracks, vias
36, 1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
17 May 2025
Updated
26 May 2025

Overview

Accesibility is an open-source printed circuit board by RaulRv007, from the RaulRv007/physics-game repository on GitHub. It is a 2-layer board of 160 × 80 mm with 6 parts on 40 nets, routed with 36 tracks and 1 via.

It is built around the ESP32-S2-WROVER-I(4M). Its parts include 5 switches and 1 IC. It belongs with the ESP32 boards of this library.

Main components

1

README

README.md

Physics-Based Multiplayer Platformer 🎮✨

Overview

This repository contains a physics-driven, multiplayer platformer game built with p5.js and Matter.js, targeting the Grade 11/12 ICS2/3x Programming curriculum. Key features include:

  • Procedural Level Generation 🏗️: Chunks of varying types (flat, stairs, pits, swings, climbable sections) are generated in sequence.
  • Tethered Multiplayer 🤝: Up to 4 players are connected by ropes, introducing cooperative mechanics.
  • Digital Countdown Timer ⏲️: A 2-minute timer governs each play session.
  • Accessibility Keyboard ♿⌨️: A custom BLE keyboard built on an ESP32 with 5 pushbuttons for alternative controls. This keyboard allows people with reduced mobility in their hands to play the game easily.
  • Custom PCB 🛠️: Designed in KiCad to host the ESP32 and buttons.

Table of Contents

  1. Design & Planning 📝
  2. Installation and Setup 💻
  3. Game Controls 🎮
  4. Code Structure 🗂️
  5. Pseudocode 🧩
  6. Hardware Accessibility ♿
  7. KiCad PCB Design 🛠️
  8. Future Improvements 🚀
  9. References 📚

Design & Planning

Before writing code, the following steps were completed:

  1. Sketches ✏️: Hand-drawn layouts showing:

    • Main menu with player-selection buttons
    • In-game HUD (timer, stamina bars)
    • Chunk types and transition logic
    • Graphics theme
    • Sprites style
  2. Specifications:

    • Audience: Teens and beginner programmers.
    • Unique Selling Point: Cooperative, rope-tethered movement with procedurally generated chunks.
    • Start/End: Game starts at main menu; ends when timer runs out or players reach the end-zone.
    • Scoring: How fast the team gets the stolen piece into the endzone 🏁
    • Challenge: Random chunk sequences that adapt difficulty.
  3. Pseudocode: High-level representations of core algorithms (see section below).


Installation and Setup 💻

  1. Clone the repo:

    bash
    git clone https://github.com/username/physics-platformer.git
    cd physics-platformer
  2. Serve with a local HTTP server (required for p5.js assets):

    bash
    npx http-server .
  3. Open http://localhost:8080 in your browser.

  4. Make sure the assets/ folder is alongside index.html.


Game Controls 🎮

  • Keyboard (default):

    • Player 1: W (jump), Q (left), E (right)
    • Player 2: X (jump), Z (left), C (right)
    • Player 3: O (jump), I (left), P (right)
    • Player 4: N (jump), B (left), M (right)
  • ESP32 BLE Keyboard (alternative accessibility): 5 buttons mapped to jump/left/right for one player via BLE HID. Ideally everybody would have a different keyboard, but for testing we only produced one


Code Structure 🗂️

text
/src
├── mySketch.js      # Main p5.js sketch and game loop
├── Chunks.js         # Procedural chunk definitions
├── MapGenerator.js  # Sequencing and world creation
├── Player.js        # Player class: physics body, controls, stamina
├── Button.js        # HUD buttons
├── Piece.js         # class that controls the stolne piece
├── DigitalTimer.js  # Countdown timer logic
└── BLEControl.ino   # ESP32 BLE Keyboard firmware
/assets             # Sprites, sounds and fonts

Key Classes

  • Chunk: #createBodies() methods for each type (flat, stairs-up/down, pit-platforms, swing, climb, end).
  • MapGenerator: Reads a sequence array and instantiates Chunk objects at startX + n * chunkWidth.
  • Player: Encapsulates Matter.js body, controls, stamina, and rope tethering.
  • DigitalTimer: Uses millis() to compute and display remaining time.

Pseudocode 🧩

Chunk Sequence Generation

pseudo
function chunkSequence(numChunks):
     sequence = ['flat']
     for i in 1..numChunks:
          last = sequence.last()
          if last in ['flat', 'stairs-up', 'pit-platforms']:
                nextType = random(['climb','stairs-down','pit-platforms','swing'])
          else:
                nextType = random(['climb','stairs-up','pit-platforms','swing'])
          sequence.append(nextType)
     sequence.append('end')
     return sequence

MapGenerator.generate()

pseudo
currentX = startX
for each type in chunkSequence:
     hasStairs = (peekNext == 'stairs-down')
     chunk = new Chunk(type, currentX, startY, chunkWidth, hasStairs)
     chunk.addToWorld(world)
     chunks.push(chunk)
     currentX += chunkWidth
# add final end chunk

Player.handleControls()

pseudo
controls = {id: {up,key, left,key, right,key}, ...}
for each player:
     if keyIsDown(controls[id].up) and stamina>=min:
          applyForce(0, jumpForce)
          reduceStamina()
     if keyIsDown(left): applyForce(-force,0)
     if keyIsDown(right): applyForce(force,0)

DigitalTimer

pseudo
elapsed = (millis() - startTime)/1000
remaining = max(0, totalSeconds - elapsed)
minutes = floor(remaining/60)
seconds = remaining % 60
if remaining==0: finished = true; onFinishCallback()

Hardware Accessibility ♿

To support players with limited mobility, a custom BLE keyboard was designed:

Accesibility drawing

  1. ESP32 configured as a BLE HID device using BleKeyboard.h.
  2. Pushbuttons: 5 buttons wired to GPIO pins (Jump, Left, Right, Jump-Right, Jump-Left).
  3. Debounce Logic: Simple software debounce with state flags and 10 ms delay.
  4. Firmware: assistive_button.ino maps button presses to HID key codes (W, Q, E, etc.).

Plug in the ESP32 and pair it with your computer/game device. Buttons emulate a keyboard—no extra drivers needed.

The decision for this setup is that in total it would be really cheap to produce. and it has a high reproducibility. It is not the best design by far, the push buttons are too small that the user gets almost not haptic feedback when the button is pressed. However talking with the group, this was the easiest and cheapest solution that we came out with. Also as it uses a 3D printed cage, everybody can recreate it easily at home.


KiCad PCB Design 🛠️

A custom PCB hosts the ESP32 module and buttons:

  • Schematic: ESP32-WROOM module, 5 momentary pushbuttons, pull-up resistors, USB power.
  • Board Layout: Compact footprint with labeled button silkscreen.
  • Gerbers: Uploaded in /pcb/gerbers/.

PCB Layout 3D PCB Layout Sketch PCB Electric Scheme


Future Improvements 🚀

  • Custom chunk creation with a system similar to mario maker
  • More chunks to increase game dynamic
  • Once in the market, get the feedback from the players and tune the physics engine (Matter.js)
  • Improve some problems on the design of the accesibility keyboard (It works but there are some problems on the design)

References 📚


Good luck and have fun playing! 🎉

Parts

6
QtyValueFootprintReferences
5SW_PushButton_Switch_SMD:SW_SPST_PTS645SW1, SW2, SW3, SW4, SW5
1ESP32-S2-WROVERRF_Module:ESP32-S2-WROVERU1

Questions

How big is the Accesibility PCB?

It measures 160 × 80 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Accesibility use?

6 parts, built around the ESP32-S2-WROVER-I(4M). The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Accesibility KiCad files?

From the RaulRv007/physics-game repository on GitHub, at the commit this page was made from: the board is accesibility/pcb/pcb.kicad_pcb and its schematic accesibility/pcb/pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Accesibility design in my own project?

Its repository states no licence, so its author keeps all rights: ask RaulRv007 before reusing the design.

Similar boards

  • 2 layers82.5 × 140 mmQCamPCR, the printed circuit board in 3D

    QCamPCR

    GaudiLabs/qPocketPCR

    Quantitative PCR machine detecting fluorescence using a camera

    113 parts22GPL-3.0
  • 2 layers81 × 59 mmAlarmbuddy, the printed circuit board in 3D

    Alarmbuddy

    gcormier/alarmbuddy

    The output current for sensors is limited to a few milliamps.

    34 parts22
  • 2 layers56.2 × 53.3 mmRTK1010Board, the printed circuit board in 3D

    RTK1010Board

    MS71/RTK1010Board

    Arduino Compatible RTK1010 Board/PCB

    80 parts20
  • 6 layers90 × 90 mmCansat, the printed circuit board in 3D

    Cansat

    DevKiDCosmo/SATELLITE-EDGE-MODULE

    A satellite edge module ready for competition

    220 parts2GPL-3.0
  • 2 layers40 × 43 mmSlimeVR pcb, the printed circuit board in 3D

    SlimeVR pcb

    H3wastooshort/slimeinator

    71 parts2AGPL-3.0
  • 2 layers40 × 40 mmEsp32Drone, the printed circuit board in 3D

    Esp32Drone

    HexaBitsEdu/ESP32-MiniDrone

    this project is a drone based on esp32 microcontroller and coreless DC motor

    83 parts2
  • 2 layers100 × 100 mmESP32S2 MIDI, the printed circuit board in 3D

    ESP32S2 MIDI

    jildertviet/ESP32S2_MIDI_controller

    ESP32S2 based MIDI controller with 5 sliders

    29 parts2