Back to the cards

BeanstalkBlitz

Game: racing prototype, playable here

My part
Programmer, networking
Team
5 people
When
Apr 2025
Made with
C++, Alpha Engine, Winsock, UDP

A web port of the game, single player against the AI. About 3 MB loads before you can start, and the music streams in after. A / D to move, hold Space to charge a jump, Esc to pause. Phones get touch buttons.

What it is

BeanstalkBlitz is a jump-racing game that five of us made in C++. It’s written on Alpha Engine, which is DigiPen’s static C++ library, so everything above drawing and input is our own code. You race friends or the AI up a beanstalk, pick up power-ups, avoid getting hit, and try to be the first to finish. The maps are generated each time.

It’s a prototype. The lobbies and the networking work, but the race itself still runs locally in the version on GitHub.

My role

I wrote the networking:

  • A client and a server over UDP on Winsock, each with its own listen thread.
  • A small RPC system, where every message starts with a call ID and the receiver dispatches on it.
  • Lobbies with create, list, join, leave and ready, for four racers and six spectators each.
  • A ping every second with a five-second timeout, where the client uses half the round trip to estimate the server’s clock.
  • The match start. When all players are ready, the server sends its time and four seeds, and every client generates the same maps from those seeds, so the maps never need to be sent.

I built all of this again, more carefully, a year later in GGEngine.

The web version

The game above is the same C++ code, compiled for the browser with Emscripten. Alpha Engine only runs on Windows, so I rewrote the 60 or so Alpha Engine functions the game calls on top of WebGL2, Web Audio and the browser’s text drawing, with the same names and behaviour. Eleven of the game’s own files changed, and each change is marked.

To check it still plays the same, I compiled the original map code next to the web build: over 400 seeds every leaf, enemy, power-up box and spike came out in the same place. Jumps match the original to a tenth of a pixel, and the AI takes the same time to finish (28.3 s on Windows, 28.4 s on the web).

Multiplayer can’t run in a browser, so this version is single player against the AI. While porting it I added a few things the prototype never had:

  • Two new power-ups made from art the game never used. Spring Boots make jumps 30% stronger for 7 seconds. Golden Jack makes you immune to stuns for 5 seconds and knocks over anything you touch.
  • Hitstop: the game freezes for 70 to 120 ms on a hit, longer for bigger hits, with a shake and a flash.
  • Particles for jumps, landings, the rocket, hits, pick-ups and the win.
  • A sharp countdown. The old one stretched 50 px letters 2.5 times, so the browser now draws all text at its final size.

BeanstalkBlitz was made at DigiPen Institute of Technology Singapore by team TheJumpingJacks. © 2025 DigiPen Institute of Technology. Music: “Monkeys Spinning Monkeys”, “Bossa Antigua”, “Happy Bee”, “Oppressive Gloom” by Kevin MacLeod (incompetech.com). Licensed under Creative Commons By Attribution 4.0.