Project Status

WIP: binary operations presentation


Recently I’ve been job hunting. while interviewing at one company (that eventually gave me a job offer!), I took a dev test that inspired me to put together a presentation for one of the meetup groups I help run.

One of the problems on the test asked me to create a program to draw a simple animation based on some initial character input. The animation needed to move characters left and right across a number of frames. It reminded me of some microcontroller code I wrote to animate lights on an LED strip, so I solved the problem using bit shifting.

The question, and the fact that I was told that no one had solved it that way before, inspired me to create the presentation. And to drive home the concepts I decided to make a demo project, and I turned it into a game 🙂

A look at the work-in-progress demo

The gist is that I’m creating a simple obstacle avoidance game where bricks fly in from left to right and the player needs to avoid them by moving around the grid.

The states for the grid, bricks, player, and key inputs are all stored using binary numbers and are updated via various bitwise operations.

Following along

I’m writing this game code in vanilla javascript with no extra tooling in an effort to make it easier for web devs at any level to explore the code. The whole project (which is definitely still a work in progress) is here on my github:

The plan

My plan is to:

  • Finish writing the game code (adding collisions, a life bar, and outer boundary handling)
  • Add in websockets so that multiple can watch the game live on their browsers as it’s being played (communication with binary state update messages)
  • Write a separate page that will act as a game controller for presentation attendees (one player per row with a button to launch a brick), driven by websockets
  • Write some custom microcontroller code for the esp32 in my daughter’s touch controller so we can use a custom physical game controller to play)
  • Create a slide deck and videos for a talk that talks through the different concepts and tools surrounding binary logic and operations
  • Use the demo code to highlight each of the talk points

Hopefully the multi-player use of websockets and physical controller state messages will add a fun and interactive element to the talk 🙂

Depending on how it goes I’ll likely make a more polished version of the game, make it a bit more attractive, maybe add in some a-frame for a 3d experience. We’ll see 🙂

I’ll add more WIP updates as I go!

Tags: , , ,

More Similar Posts

Most Viewed Posts