Meet Jonah! He’s a coding genius teamed up with instructor Mike M. as part of Game-U’s New Jersey Accelerate program. Remember the game Bejeweled? It’s a puzzle game that’s all about swapping tiles (jewels) to make matches. Jonah’s spent the last several weeks working on a Bejeweled-style 3-match game of his own, and he’s all set to dazzle with the results!
Using Unity, a professional gaming engine, Jonah created a board that spawns a random grid of 3D “jewels” that he modeled himself in Blender. Playing a game like Bejeweled is all about making matches, so Jonah and Mike M. randomized the board generator and coded it to detect jewels of the same color and shape when they spawn three in a row. A player’s not supposed to start out with matches already waiting! Before presenting the board to the player, the board generator uses its new powers to check for any accidental matches. If it detects any, it discards the board, generates a new grid, and repeats the process until it produces a match-free grid. The code executes so quickly that the player doesn’t even notice a delay. As the player collects matches and clears rows of jewels, Jonah’s code calls for new jewels to fill the gaps, allowing for a continuous game.
Jonah attached code to the jewels as well as the game board. Hovering over a jewel triggers an outline, clicking a jewel causes it to spin, and clicking one of the spinning jewel’s four immediate neighbors swaps the spinning jewel with that neighbor, creating matches. Clicking on a non-neighbor jewel, instead of triggering a swap, switches focus to the new jewel. With all the match possibilities this code creates, Jonah’s next challenge was a score system! Besides tracking the points each match earns, he coded multipliers for matches longer than 3 and for match cascades. Jonah’s game saves the player’s high score and uses a timer to increase the game’s difficulty the longer a player remains active. Finally, as a finishing touch, Jonah added sound effects for matches and match cascades, as well as a sound effect for colliding jewels. Bejeweled clone, complete!
Awesome work here, Jonah! You tackled more puzzles building this game than any of your players will face when finding matches. Enjoy your finished project – and let us know what new projects you and Mike M. have in mind!