During the year 2020 to 2021, during my master, I created a game that aimed to validate the C++ skills and the use of an external graphic library named SFML. The second part of this project was to design in CAD a controller and then to print it in 3D. With the help of an Arduino and some electronic components we created a functional controller and linked it to our game.
This game is a recreation of an original 1994 title of CluCLuLand. In this game we have to help Bubbles a poison to finish the different levels by forming with hidden pieces shapes. We have to dodge or kill the enemies to allow us to reach our end in a given time.
Gameplay aspect :Game : Form a shape in a given time with hidden pieces without losing all of Bubbles' lives. The level ends when all the hidden pieces have been found. In case the player has no more lives or the time is up, the game ends.
Player : He can move by holding on to the poles to change direction, he moves forward in a constant way. He can bounce off the walls to go in the opposite direction. He can kill enemies after touching them with his electric waves and increasing his score. He can be killed by contact with the enemy. His objective is to collect all the hidden coins that increase his score.
Enemy : He moves randomly on the level, he changes direction when he is facing a wall or another enemy and sometimes at an intersection. They can kill the player and they can be killed by the player. They respawn at their spawn point defined in the level.
Development specification :The project is made up of 15 classes and a main. The idea of structuring the code is to recreate the functioning of a real time engine such as Unity with update functions by scripts to have a built and structured system. The update function of each object is called at each frame and allows the refreshment of all objects. Of course each element is not based on the frame calculation but on the time to have no problem related to the framerate.
Controller Conception :About the design of the controller I first started with the electronic design to determine the functionality of it. This controller is composed of an Arduino board with a joystick for the direction. A button to jump and validate, a back button and a start button. And finally a status LED. In red to indicate power and turns blue when communication is made with the game.
Arduino Conception :Arduino electronic diagram
Controller CAD :The electronic design of the controller has allowed to determine the architecture of the controller at the level of its 3D design. It can accommodate the components mentioned above. It was designed on Fusion 360 and then printed in 3D.
Controller CAD with components
Controller 3D Print :3D printed base controller
Controller Assembly Gif :Controller assembly with all components
Controller communication :For the connection between the Arduino and the game a serial link is set up. An easy solution has been chosen. The idea is to send when pressing a button or using the joystick a character coded on 8 bits to be transmitted in a single frame. The game recognizes the character and performs the action. As you can see on the example below the characters received and the action performed.
Game with external software for controller input