Now that I have a working web server and website, I can now work on creating games to play and compete on.
I decided to make some sort of aim game, after my friend requested me to make one. I settled on making a cube clicking game, in which you click 15 cubes as fast as possible. As previously stated, creating a game goes along the lines of: 1. Create the world 2. Create objects 3. Write the code Step 1 - Creating the world To create the world I actually used an an advanced 3d game engine, Unity. The engine is the same one used for multi-million dollar games like Rust. I have had some past experience with the engine, so doing what I wanted to do, make some colored blocks pop up, took about 30 minutes to perfect. Since my framework does not render in 3d, I simply took screenshots of each block that popped up, totaling 8 screenshots, which I would later overlay onto my 2d framework. That was it for creating the world. Step 2 - Creating Objects I was very grateful that I had made my editor when I started this step. The job, which would have taken 2+ hours, only took 30 minutes. I used the editor to overlay invisible buttons onto all 8 frames of the game, meaning I could detect if they were clicked. Step 3 - Writing the code Now that I had the world layed out, I started work on the game. Since each game state corresponds with a number , 1-8, I made a randomizer that randomly selects a state after you click a cube. This is more complicated then it all sounds, but after a few hours of keyboard mashing, and a few hundred lines of code, I had a functional game. I wanted to have a leaderboard system that ties in with my database that ideally, if a user is signed in, their score gets submitted to the database when they finish. I was able to accomplish this by using socket.io, which is a simple way to transport data from the client to the server. When a user clicks the 15th and final block, their score submits to the server. If the user is signed in, their score is submitted, if they are playing as a guest, the score is disregarded. This ended up being a very successful system, as I was able, and still am able to scale the system for different stats. The finished product I am very happy with how the game ended up. My friends and I competed for top spots on the learderboard for a while. Check out the site!, it is supported on Chrome, Firefox, and Edge. The game is the one named "AIM."
0 Comments
Leave a Reply. |