Open BobTheFarmer opened 1 year ago
USAGE OF:
HOOK: Points: 3.6-4.0 Reason: Game play is very fun.
KNOWLEDGE: Points: 3.6-4.0 Reason: Very knowledgeable on game side. Backend was not discussed.
VALUE: Points: 0.6-1.0 Reason: Fun and interactive game with code theme
WOW FACTOR: Reason: Very nice looking game. Lots of two person possibilities.
9/10, this could be a lot higher with deployment.
HOOK: Points: 3.8 Reason: Doesn't fully hook in the audience but does connect to the project well.
KNOWLEDGE: Points: 4.0 Reason: Shows screenshots of code and explains their uses. Has good knowledge of their features and how their code works.
VALUE: Points: 1.0 Reason: Their biggest aspect is their race + chatbox, which is well developed. Has value of helping people code quicker.
WOW FACTOR: Reason: Moving cars and user input.
Criteria/Key Features:
HOOK: Points: 3.9 Reason: Super enthusiastic and entertaining. Similar to NitroType which was a game I enjoyed as a kid
KNOWLEDGE: Points: 4.0 Reason: Everyone was very knowledgeable about the topic
VALUE: Points: 1.0 Reason: Helps people type code faster and understand syntax well
WOW FACTOR: Reason: I loved the fact that you could play this game with multiple people
8.9/9
USAGE OF: HOOK: Points: 3.6-4.0 Reason: Super exiting and entertaining. The game was very fun.
Code runs and connected to the backend Data interpreted in the frontend, moving the cars appropriately. KNOWLEDGE: Points: 3.6-4.0 Reason: Everyone could talk and explain the project they created
Extensive review below VALUE: Points: 0.6-1.0 Reason: It was a fun typing game that could help people learn how to type with greater speed. It was also a fun game.
Helps students learn the java coding language in a fun and easy way WOW FACTOR: Reason: Multiplayer!
8.8/9
HOOK: Points: 4.0 Reason: Super enthusiastic and entertaining. Similar to NitroType which was a game I enjoyed as a kid
KNOWLEDGE: Points: 4.0 Reason: Everyone was very knowledgeable about the topic
VALUE: Points: 1.0 Reason: Helps people type code faster and teaches very basic aspects of coding
WOW FACTOR: Reason: I loved the fact that you could play this game with multiple people and its very competitive so I can feel better when I beat little children at the game
9/9
USAGE OF:
HOOK: Points: 3.6-4.0 Reason:
KNOWLEDGE: Points: 3.6-4.0 Reason:
VALUE: Points: 0.6-1.0 Reason:
WOW FACTOR: Reason:
Frontend
Game control loop
Overview/goal of this code
The frontend needs a central script to update the positions of the cars from the API data. It's also important that this script is well-connected both to the animation and the backend, acting as the connector.
Use of OOP
I want to store the position data in an object that mirrors the backend objects. This will make the process of updating the player positions easier. The Player object needs to do four things:
Notice how the update takes all the JSON data and interprets it rather than just take its own data. That will make the code more concise and easier to write later.
Challenges from writing this code before other parts of the project are ready
This code will serve as the 'glue' connecting the backend to the animations on the frontend. However, in order to test this code before those two parts were ready, I had to be creative with where data is received and sent.
Ticking system
To avoid inconsistencies in how fast positions are updated depending on connection speed, I used a ticking system to only call the API over some interval. A constant is used to make this interval easily adjustable.
SIgn in page
This page will be the landing page where players will sign up. I tried to make it follow a racing color scheme and theme while also being easy to follow.
For now, this page is essentially a wireframe. However in the future it will link to the backend and be responsible for assigning players to their cars in the game.
Typing System
Integrating old demo code
The original demo had some basic code for the typing system with a few temporary words. I used some of this code as a base to start with the new system.
However, most of the code, which was in the checkWord() function cannot be used as it directly updates the frontend and in a different way than we are going to do with exponential movement.
New way of doing it
The code has become a lot simpler and shorter because we got rid of the acceleration. All the code needs to do now is check the typing box and generate new phrases.
Backend
Issues we faced
The Problem
The backend developers are having trouble working on the API because they cannot localhost or deploy the backend. Whenever someone tries to localhost, they get a jwt error and postman does not receive any data.
What we tried
We mostly focused on the jwt error which we now know was not the problem. I tried:
This did not work, however, it did give us a different 404 error which confused me more.
After consulting with Mr. Mort
We learned that the jwt error is not a problem. It simply happens because the requests from postman are not associated with the jwt cookies so requests to the person api can't be verified.
Mr. Mort told me that the problem may have come from the newest version of Spring. We recloned the repository so that is why other teams did not have this issue.
Using GitLens to fix it
Mr. Mort also showed me how to use GitLens to investigate this further. GitLens is an extension in vscode which allows you to easily back up to previous commits. We used this to find that going back a couple of weeks allows the backend to run correctly.
How I will avoid mistakes like this in the future
I wasted a lot of time investigating the jwt error, but it turned out it was not important to the overall problem. In the future, I will be more careful not to blindly follow the error but read it carefully and take a more direct approach to the problem, rather than just look for anything related to the error in the code. I will also not be afraid to ask for help if I get stuck on something like this.
Phrases API
Why we need this API
In our game, the player will type from a bank of phrases. We want the bank to be scalable and extremely large. Storing it on the frontend may cause lag and is unnecessary, so we are going to put it on the backend.
'Sculpting' approach
The jokes API already provided by Mr. Mort is very similar to what I need to make. All I needed to do was remove the like and jeer system, leaving only the index and the jokes in the API.
The final phrases API is just like the jokes API but with all that removed. Here's what that looks like:
AI generating the new phrases
Now all we have to do to customize the API is change the phrases to whatever we want. I am going to generate the phrases by using chatGPT. The benefit of this is that it will format them in JSON so no formatting will be needed on my part.
Players API