Adding Games

We were tasked with integrating 25 non-interactive games into our client's app, a challenge we accepted with enthusiasm. This blog post aims to share our experience, the hurdles we encountered, and the innovative solutions we deployed to make this integration a success.

Our initial strategy for incorporating these games into the app was straightforward. We decided to create a separate .tsx file for each game. This approach seemed logical at the beginning, as it allowed us to structure each game independently. We proceeded to create skeleton files for each game, laying the groundwork for what we thought would be a smooth development process.

As we delved deeper into the development phase, we began to encounter several challenges. The primary issue was the realization that managing separate .tsx files for each game would not only be cumbersome but also contrary to good coding practices. The games, despite their variety, shared a common format, including elements such as images, audio files, titles, descriptions, aims, and materials. Maintaining separate files for each game would lead to unnecessary repetition and complicate future maintenance.

Recognizing the need for a more efficient and sustainable approach, we decided to pivot our strategy. We consolidated all game data—links to images and audio files, titles, descriptions, aims, and materials—into a single JSON file. This decision marked a significant turning point in our development process.

With the game data centralized, we then created a single game.tsx file. This file was designed to dynamically navigate to the chosen game based on the user's selection. This approach not only streamlined the development process but also enhanced the app's performance by reducing the amount of redundant code.

To further refine the user experience and prepare for future functionalities, we implemented a games database. This database allows us to track metrics such as the number of times each game is viewed. It serves as a foundation for future features, such as personalized game recommendations and tracking user progress.

Comments

Popular posts from this blog

Blog Post written by our clients Jo Van Herwegen and Laura Outhwaite

Meeting PhD students regarding design of app and accessibility features

A New Direction: Embracing the Maths@Home Challenge