We designed and implemented several mini games for a primarily educative game aiming at improving English pronunciation by native Chinese speakers through speech recognition. We developed a total of three mini games, one of which was completely worked out and ready to be implemented in the final product, while the other two were delivered as prototypes.
Although all three mini games are separate from each other, they do use a lot of the same code. For example, they all use a very similar game loop to update variables and render the graphics, using the same base game states. The voice recognition is also used in the same fashion. These similarities would make it quite easy to create a new mini game out of the existing code.
During implementation, we did stumble upon several difficulties. At first, we had to create a game loop. We first tried to achieve this using a storyboard, which did not turn out very well, as the loop would stop after some time. We then decided to implement a game loop using the event that is fired every time a new frame is rendered.
Another issue that came up was the lag that started to appear as we started to use higher resolution images. Noticing a short delay when new images were created, we soon figured that this was the cause of the lag. We solved this problem by pre-loading all needed images, setting them to an invisible state. This caused some loading time when the game was first started, but it made the game itself a lot smoother.
Another problem was ensuring a correct, synchronous 3D animation in a 2D environment for two objects. Tweaking variables and adding in some calculations, we eventually found an animation that seemed correct to the human eye, and was also mathematically correct in most ways. We synchronized both objects by simply using the same transformations.
This project was implemented using C# and WPF.