Project 5 - 3D Snake Game
It's been a few months since the last entry. I've made a few small render projects which I might add to their own post at a later date. I'd like to focus this one on the big project I have worked on. I have finally made my own finished game. The game is a 3D snake game. For those who don't know, Snake is a game where a 2D snake has to move across a playing area and collect apples. Once the snake collects an apple, it gets longer. The game ends when the snake crashes into a wall or itself.
I have seen many people make their own version of this game but so far I have never seen anyone else make a good 3D version. This would mean the snake can not only move side to side but also up and down in a cube playing area. Originally I planned to make this game in Unity as it is what I am most familiar with but I decided to move to Godot due to recent changes in Unity pricing. Godot is very modular and node based which really helped build into the game I wanted to make.
To start I had to decide how the snake and camera would move. Most snake games use a top-down camera to see the snake at all times. This works well for a 2D game but after some experimentation I felt like a first person camera would suit my game better. As for the movement, I went with two modes. One is "classic" mode, which means you can only turn at 90 degree angles, and that's fairly standard in snake types of games. I also added a "free move" mode where the snake can turn at any angle, this is how most first person games work so I thought it would make more sense to control. After the controls I made some simple textures as well as a mini-map in the corner to inform players where the apple is and where the snake's body is.
The next step was making a pleasant user interface. The interface I had up to this point was very bare-bones and quite unpleasant. I had never made a good user interface before, I'm typically more of a back-end person, but I thought it would be fun to branch out and do it. I started with something I was familiar with and I used my favorite 3D software, Blender, to make a title logo for the main menu. After that, it was on to button design. I had a rough idea for what they should look like so I took to Photoshop and got to work. The menu buttons I ended up with are fun, rounded buttons, that have the colors of the snake and apple. In this stage I also added a simple settings menu to change the turn sensitivity and a few other things I planned to add.
After the menu, themes were the next thing to include. I wanted the ability to change the colors and textures of the snake, apple, and playing area. This wasn't that hard and was just a script at game start that tells the objects which material to choose from. I ended with five unique themes. These are, browser, retro, realistic, block game, and mono color.
The final feature that was added was mouse turning. I wanted to be able to control everything with only the mouse. There were several ways I could do this and I thought the most fair was mouse distance based turning. This means that the further away from the center of the screen the mouse is, the quicker the snake will turn. This makes is so I can limit the maximum speed the snake can turn while still making it easily usable. This was fairly difficult to implement but I quite like the end result.
After that the only things to do were little housekeeping things. I added controller support to all the menus, fixed some bugs, and optimized the code. The game is playable both in the browser as well as in the form of executables for Windows and Linux. You can find it at fluffpumpkin.itch.io/snake-3d. I'm quite proud of the result and may work on more games in the future.
Comments
Post a Comment