Skip to content
AntondeGrootPublic

About

Tock is a game like Ludo / parcheesi / mens-erger-je-niet but with playing cards instead of dice, giving you more possibilities to annoy your opponents!

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Tock

A digital version of the Tock (Keezen) board game: an Angular frontend served by a Spring Boot backend.

What a game looks like

Two to eight players. Each game below is shown twice — the same seeded position on a computer and on a phone, since the board switches to a dedicated layout on narrow screens.

2 players

The smallest game: two sections facing each other. Every player plays for themselves.

On a computer On a phone
2 players, on a computer 2 players, on a phone

2 players on a four-seat board

The same two players, given twice as much board to cross. With this option on they sit opposite each other on a four-seat board and the seats between them stay empty: plain track with no nest, no finish lane and nobody waiting for a turn there.

On a computer On a phone
2 players on a four-seat board, on a computer 2 players on a four-seat board, on a phone

4 players

The classic setup: four sections, four pawns each. The board always rotates so your own section is at the bottom and the other players fan their cards around you.

On a computer On a phone
4 players, on a computer 4 players, on a phone

6 players, in teams

With team play on, an even number of players pairs up with the seat opposite — six players make three teams. Each pawn flies its team pennant and the roster lists the pairs; once all your own pawns are home you play your teammate’s.

On a computer On a phone
6 players, in teams, on a computer 6 players, in teams, on a phone

Splitting a seven across two pawns

A seven is the one card you may divide between two of your pawns, in any share that adds up to seven — three steps for one and four for the other here. Pick the card and both pawns, then set the split. Every other pawn is still in its nest, so the only two on the board are the two being moved.

On a computer On a phone
Splitting a seven across two pawns, on a computer Splitting a seven across two pawns, on a phone

Asking your teammate for a King or Ace

Only a King or an Ace gets a pawn out of the nest, so with the team-trade option on you may ask your teammate for one. The button asks there and then — your teammate already has the message — and all that is left is picking what you give back. The cards swell in turn until you do; tapping one sends it, and tapping another changes your mind.

On a computer On a phone
Asking your teammate for a King or Ace, on a computer Asking your teammate for a King or Ace, on a phone

Your teammate hears it straight away

The other side of that moment: the ask arrives before you have chosen anything, and your teammate can answer it at once. Once they have handed a King over it simply waits for you — whichever of you picks last completes the swap.

On a computer On a phone
Your teammate hears it straight away, on a computer Your teammate hears it straight away, on a phone

Handing one over

Your side of the swap. Everything but the Kings and Aces is dimmed out — those are the only cards that answer the ask — so you either give one, or decline.

On a computer On a phone
Handing one over, on a computer Handing one over, on a phone

When they cannot help

A teammate holding neither a King nor an Ace can only decline. The answer reaches you as a banner, your offered card stays in your hand, and the trade window closes — you are free to ask again after the next deal.

On a computer On a phone
When they cannot help, on a computer When they cannot help, on a phone

How the board is built

Keezenspel construction

Running the app

The Spring backend serves the built Angular app (this is what ./deploy.sh ships):

cd frontend && npm run build
mvn spring-boot:run -pl backend -am -Penv-angular   # Angular served at http://localhost:4200/

For frontend hot-reload dev, cd frontend && npm start runs ng serve on 4201 and proxies the API to the backend on 4200.

Deploying to Raspberry Pi

Run ./deploy.sh to build the Angular app, package it into the server WAR (env-angular), and deploy it as keezen.war into the shared Tomcat on the Pi. Tomcat is installed by the GameRoom project (setup-tomcat.sh); this repo only drops the WAR in.

The app is reached at /keezen end to end. The Angular build sets base-href=/keezen/, and the app derives the prefix from <base href> at runtime (basePath() in src/app/base-path.ts) so the browser requests /keezen/games, /keezen/gamestates/…/stream, /keezen/study-icon.svg, etc. Tomcat serves keezen.war at context path /keezen, so nginx forwards the prefix unchanged:

location /keezen/ {
  proxy_pass http://127.0.0.1:8090/keezen/;
  proxy_set_header Host $host;
}

Locally (java -jar, mvn spring-boot:run) the backend still serves at the root on port 4200, and local dev/tests run at the root too (default base-href / → basePath() returns '').

Built with

  • Angular (TypeScript) — the frontend UI
  • Spring Boot — the backend and game engine
  • OpenAPI — the API contract and generated TypeScript client
  • Testing — JUnit + Vitest unit tests, Playwright end-to-end browser tests, Mockito
  • Continuous Integration

This started as a GWT project (Java compiled to JavaScript) and was migrated to Angular.

About

Tock is a game like Ludo / parcheesi / mens-erger-je-niet but with playing cards instead of dice, giving you more possibilities to annoy your opponents!

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages