Some Background
At a previous job, I was tasked with making BINGO cards. There were 50 cards in total: 25 unique background designs with 50 different numbered setups. This means designs were duplicated.
I designed the original cards in Adobe Illustrator. I didn’t have the time to learn how to use InDesign which, based on my limited research, would have made this a million times easier.
Fast forward a few years and I want to make more cards. I again looked into using the Data Merge function in InDesign. A csv or txt file is needed for Data Merge, so my first attempt in creating the card was in Google Sheets.
This ended up not working out because I couldn’t get the numbers working right in Sheets and I didn’t feel it wasn’t going to be as efficient as I wanted it in InDesign.
There was also a short lived attempt at making some type of web app, but that didn’t pan out either.
Eventually I joked, “I could do this in After Effects.” So I did.
BINGO CARD EXPRESSIONS
The expressions I use are formatted for the new Javascript engine in the newer versions After Effects, so make sure you have that selected in project settings.
[Project Settings > Expressions > Javascript]
Each column is a single text layer, driven by an expression to shuffle the array for that given column. I had to search around for the right mix of functions to make this work and modify it a bit to work in AE.
The expression uses the Fisher-Yates Shuffle algorithm to shuffle the array (created by a fancy javascript array creation method I don’t fully understand). This shuffles every frame, but could be changed within the expression or via time remapping.
Here’s the expression I used for the Source Text in the B layer.
function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; // While there remain elements to shuffle... while (0 !== currentIndex) { // Pick a remaining element... randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; // And swap it with the current element. temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; } const range = (start, end) => { const length = end - start; return Array.from({ length }, (_, i) => start + i); } var arr = range(1,16); // Determine the range of the array shuffle(arr); // Shuffle the newly created array arr.join("\n") // Separates the array with a line break
Simply duplicate the layer 4 times and change arr = range(1,16); to match the correct values for each column. That’s pretty much it as the rest is just design.
DESIGN
Here’s a quick overview of what I did for design. I like making things flexible so I can iterate quickly, or drive other pieces of design via expression.
You can control the spacing of the numbers two ways:
With the Leading value in the character panel (not flexible)
Using a Line Spacing text animator (flexible)
For color I created the background as the main element and the small square and the top bar are shapes with blend modes. The board background has 3 sliders for RGB values that have random(0,255) for a value. Color accepts a 4 part array [r,g,b,a] with values between 0 and 1.
It’s fun to look at the post-expression graph for color
Wrap up
I can now use this to create as many combinations as I want. I could design the entire card in After Effects or export a PNG sequence of only numbers and do with it as I please. I think extending the card to work with Master Properties for design and animations would be the next step for this. The possibilities are endless with BINGO.