A web-based Sokoban game built as a personal challenge in June 2024.
Sokoban is a classic puzzle game where the player pushes boxes onto target locations. The player can only push boxes (not pull), and can only push one box at a time.
This game was developed under the following constraints (only initial commit):
- No graphical user interfaces - Development done entirely in a text terminal. Graphical resources could be searched on the browser, but image editing was done in terminal only.
- Android phone only - All development was done on an Android phone using Termux.
- Separate cloud backend - The server is intentionally hosted in Europe (far from the development location) and communicates via an API.
- Persistent game state - Game progress is stored in Google Cloud Storage.
- One day implementation - The entire project was implemented in a single day.
GitHub Copilot was used during development, but no other agentic coding tools were used.
- Classic Sokoban gameplay with multiple levels
- Keyboard controls (arrow keys, wasd, or Vim-style hjkl)
- Touch input support (tap on screen quadrants to move)
- Undo functionality
- Level reset
- Cloud-based game state persistence
| Key | Action |
|---|---|
| Arrow keys | Move |
| w / a / s / d | Move |
| h / j / k / l | Move (Vim) |
| u | Undo |
| n | Next level |
| r | Reset |
Touch the screen to move the player:
- Left side of screen: Move left
- Right side of screen: Move right
- Top of screen: Move up
- Bottom of screen: Move down
- Backend: Go
- Frontend: Phaser 3 (JavaScript game framework)
- Storage: Google Cloud Storage
- Build: Webpack with Babel
sokoban/ ├── cmd/ │ └── webserver/ # Go web server ├── data/ │ ├── app/ # Frontend application │ │ ├── src/ # Source files │ │ └── dist/ # Bundled output │ ├── assets/ # Game assets (tileset) │ ├── index.html # Main HTML page │ └── levels.txt # Level definitions ├── logic/ # Game logic └── storage/ # Storage implementations
- Google Cloud ADC
You need gcloud application-default authentication for local development.
gcloud auth application-default login - Build the frontend:
cd data/app npm install npx webpack --mode development - Run the server:
go run ./cmd/webserver - Open in browser: http://localhost:8080/game/your-game-id
A push to main deploys after CI passes. The Deploy workflow writes app.yaml
from app.yaml.example, rebuilds the frontend, and runs make deploy.
Add these GitHub Actions secrets before merging, or the first deploy fails:
GCP_PROJECT_IDGCP_WORKLOAD_IDENTITY_PROVIDERGCP_SERVICE_ACCOUNTGCP_BUCKET, the value that replacesyour-bucket-name.appspot.com
The deploy service account needs App Engine Admin, Storage Admin, Cloud Build Editor, Artifact Registry Reader, and Service Account User on the App Engine runtime account. Use Workload Identity Federation so GitHub has no long-lived key: https://github.com/google-github-actions/auth
To deploy from a machine, copy app.yaml.example to app.yaml, set the bucket
name, install the frontend dependencies, and run make deploy.