Discover the game !
Play the game
What is Class Trouble ?
Class Trouble is a virtual reality game that helps you learn English vocabulary in a fun and interactive way.
You play as a student in a VR classroom, where you must find objects and click on them to advance in the game.
The game
Learn vocabulary while having fun!
Find objects and learn related vocabulary.
In Class Trouble, you'll be given tasks that require you to find objects in the classroom. As you discover them, you'll learn the vocabulary related to each item, helping you improve your English skills while having fun!
Customize the game
Earn money by passing tests and answering correctly. Use your earnings to customize the classroom or the teacher’s appearance. Choose from a wide range of colors and skins to make the experience even more fun!
Have fun with the environment !
During the test, if you answer incorrectly, the teacher can throw a ball at you. After that, you can play with it wherever you want.
Interact with your classmates and the things around you.
You can interact with your classmates by pushing them. On PC, you can grab and throw them anywhere. You can also interact with objects like chairs, plants, and more.
Trailer of the game !
Details of Our Project
Click here to see our code!
Our planning process
We have completed all the tasks we needed to accomplish. Although we didn’t always finish on time, we worked hard to overcome the challenges that arose. Along the way, new tasks were added, but we managed to handle them effectively. We stayed focused and kept working until everything was done, even when things became more challenging.
Average time spent on our project per person
120h
Tools and resources used for this project.
This is our awesome Team
Cyriaque
Interaction & Game Designer & VR Debugger
François-Pierre
Game Designer & Animation Maker
Florian
Test Maker & Interaction
Phase 1
I started this project by working on the object selection, determining how the vocabulary would work, and how it would appear before the test begins. First, I selected different objects and added a hover effect (scaling and looping) to indicate to the user that they can click on them. Phase 1 was relatively easy to implement, but it underwent a lot of optimization over the weeks.
Test
Next, I began coding the main goal of the game: the test. First, I designed the test interface (a paper with the questions and responses). The questions are dynamic and interact with an API (see the next section). They are also randomized, so each user will receive different questions and responses. During the test, I implemented a round system and a counter to display the number of questions remaining until the end.
I had to integrate a lot of code from François-Pierre and Cyriaque. For example, I had to disable certain physics and movement features, as well as add the money system for François' shop. The main goal of this part of the code was to make things easier for François. This code is visible at the end of the test, where the final sentence appears.In the final part of the test, I worked on the judgment system. I had to check each user click to determine whether they selected the correct response. If they chose correctly, they earned 2 shop credits; if they were wrong, the teacher would get mad. The animation for this was created by François-Pierre.
API
In the final part, I had to build an API to make everything dynamic. I started by creating a database in phpMyAdmin for the sign-in and sign-up system, questions, responses, and the shop. Then, I developed the backend of the API using various classes, controllers, and repositories.
On the third part, I host the api on https://florian-bounissou.fr/ClassTrouble/SAE402-4-api/api/.
At the end, I make the frontend with the api-request and change the code of the store, user and the test to implement the API.
Creation of the scene
I began by creating entities with A-frame in html to set a classroom environment. I used patterns for the ground and the ceiling and built entity by entity the whole classroom. First, by hand, and then with the help of a 3D inspector when I discovered it. I had to balance the color, the rotation, the scale and the position. After that, I imported 3D models chosen on Poly.pizza.
Lights
Then I had to add special lights to my scene to be able to see the 3D space. I created an ambiant light to see everything in my scene and I created a directional light to imitate the sun light and cast shadows on the scene. I finally created a point light for the classroom light.
I managed to cast and/or receive shadow and to edit the reflexion of the objects surface with their material.
And I used the inspector to edit the shadow size and the light intensity.
Physics
I added physics to the scene so the game would be more realistic. I used online libraries such as aframe-physics-system or aframe-extras.
With aframe-physics-system, elements with dynamic-body are affected by gravity and restitution that can be edited. Static-body elements stay in place but have collisions with other dynamic-body objects.
Aframe-extras provide features like move-abilities for every platform or even constraint to navmesh.
A navmesh is a 3D model that defines the area where the player can move so the player feels like he can’t go through walls and structures.
I built the classroom navmesh with the aframe-inspector-plugin-recast that provide an extension to the 3D inspector to create a navmesh based on a simplified scene with a few basic shapes.
To create collisions between the player and dynamic objects, I created an invisible static-body element that follows the camera.
Camera
To a create first-person game, I needed to set multiple camera settings. First I had to create a rig around the camera for the VR to be able to move in the scene on PC and in VR. I had to define different camera positions for the PC and for VR, as the mode of use is not the same. VR controllers are also placed in the platform to follow the player's movements.
VR Experience
I was in charge of the VR aspect because I have an Oculus Quest 2 so I could use it whenever I wanted. I had to test our code in VR and make it functional everytime we added something by pushing it on my github.io page.
Sound design
To make the game more lively, I made the sound design. I imported an ambiant sound and created multiple sound interactions. I have put a sound interaction on every object the player has to interact with, on the answers of the test, and on the teacher.
Scene
I collaborated with Cyriaque on designing the decor of the game, but my focus was primarily on the outdoor environment. I was responsible for placing and arranging the exterior elements to create a cohesive and immersive setting. Additionally, I selected and positioned the students within the scene to ensure a natural and dynamic layout. I also manage the aquarium and its fish, carefully placing them to add life and detail to the environment.
Shop
During this project, I worked on creating the shop. If you click on the market manager or the items on the table, you can access the market rules or view item details. You can purchase items by clicking on them, and if you have enough money, you will see that the classroom or the teacher changes accordingly.
If you buy a color upgrade and have enough money, most elements in the scene will update to match the new color. For the teacher, I handled this carefully by downloading in Poly Pizza a pack containing different variants of the same character. This ensured that switching between character models wouldn’t break the animations, as different characters might not share the same animation names, which could have caused issues.
Animation
I worked on various animations in the game to enhance the player experience. For example, I created an animation where the teacher walks over to punish the player if they make a mistake during the test, adding a sense of realism and interaction. Additionally, I designed an animation where the teacher throws a ball at the player as a form of correction for the same reason, making the gameplay more dynamic and engaging.
To implement these animations, I used a setTimeout function to trigger the next animation each time the previous one finished. This technique ensures a smooth transition between animations, making the sequences feel more natural and fluid. By carefully adjusting the timing and sequencing, I was able to create a more immersive and engaging experience for the player.
Local Storage
During the project, I implemented localStorage to store user data, allowing them to resume their progress and retrieve the items they had purchased. When the user enters their name in the first scene, I check localStorage to see if a value associated with their name already exists. If it does, they can start the game with the money, items in the shop, and the rounds they have already completed. Otherwise, I create a new user in the player table and store their name in localStorage to access it whenever needed. Later, we modified localStorage so that Florian could integrate his API, improving data management and accessibility within the game.
Improvement not implemented yet
Grab/ Throw
We planned to implement a grab-and-throw system to allow the player to interact with objects in the classroom. However, we were unable to complete this task due to time constraints.
Fish Quest
We created a quest where you have to place a fish in the fish tank to save it and gain access to new words. However, this feature is currently unavailable because we were only able to make the grab function work on the computer, but not with the VR headset.