Built in 2019
Hexagon Snake
Mobile Snake Game
Mobile snake game, where the board is made with hexagonal shapes and the snake is able to move in six directions.
Classic Snake has four directions. The snake moves up, down, left or right, and every turn is a 90 degree angle. After a while, that limit makes the game predictable.
I wanted to break that pattern. What if the board used hexagons instead of squares? What if the snake could move in six directions instead of four?
Hexagon Snake was my experiment with an unusual game grid. It is a mobile game where the shape of the board changes everything.
Six neighbors, not four
The core loop is the same as the original Snake. You steer a snake, eat food, grow longer and avoid hitting yourself.
The hexagonal board changes how you think about movement. Each hexagon touches six neighbors, so you have six directions instead of four. The snake turns at 60 degree angles instead of 90.
This small change has big effects. There are more ways to escape. Traps become harder to build. The game feels smoother, and also more complex.
Rows that shift
A hexagonal grid is harder to build than a square one. Squares fit together perfectly, and their neighbors are obvious. Hexagons need more thought.
I built the grid with an offset coordinate system. Every other row is shifted a little to the side, which creates the honeycomb pattern. This kept the neighbor math manageable without complex formulas.
Each position has two values. Moving between hexagons follows different offset rules depending on whether the row is even or odd. The game logic handles those differences behind the scenes.
Sharp and shallow turns
In a square grid, turning right from “up” gives you “right.” That is all.
In a hexagonal grid, turning right from any direction gives you one of two possible angles. The snake can make a sharp turn or a shallow one. I mapped both to swipe gestures on the phone.
Swipe right for a shallow turn. Swipe hard right for a sharp turn. The gesture detection needed tuning to feel natural. If it was too sensitive, players made turns by accident. If it was too loose, the snake ignored real input.
Edges that are not straight
Collision detection on a hexagonal grid had its own problems. The snake’s body is made of hexagonal segments, and each segment fills one cell.
The head checks its next cell before it moves. If that cell holds a body segment, the game is over. If it holds food, the snake grows. If not, the head moves forward and the tail follows.
The border check was harder. The grid has edges, but hexagonal edges are not straight lines. I defined the list of valid coordinates and rejected any move that would put the head outside them.
Swipes become directions
The game uses swipe gestures to change direction, so the touch controls needed careful design.
The control system reads both the direction and the length of each swipe. A short swipe means a small correction. A long swipe means a sharper turn. This smooth input maps to the fixed set of six directions.
I added visual feedback for touch input. When you swipe, the chosen direction appears for a moment. That shows players how the game understood their gesture.
A clean honeycomb look
Hexagons look good on their own. The honeycomb pattern gives the game a clean, geometric style.
The snake’s segments fit neatly into their cells. Each segment overlaps its neighbors a little, so the body looks connected. The head has its own shape, so you can tell which way the snake faces.
I picked colors with high contrast. The snake stands out against the board, and the food is easy to spot. That matters on phone screens in different kinds of light.
Built with Unity
Unity was a good fit for this project. The engine handles 2D games well, C# is comfortable to write, and mobile builds work out of the box.
The hexagonal cells are prefabs, which are ready made objects that Unity copies when the game runs. The grid is generated at the start, based on dimensions you can configure. That keeps the scene file clean and makes different levels possible.
A central manager holds the game state. It coordinates the snake, the food, the score and the collisions. Every frame, it updates positions and checks for events.
Unlearning the square grid
The hardest part was understanding hexagonal geometry. Square grids feel natural. Hexagonal grids fight against years of thinking in squares.
Drawing the hexagons correctly took several attempts. Choosing between flat-top and pointy-top hexagons affects every other calculation. I chose pointy-top because vertical swipes felt more natural for moving forward.
Tuning the touch input took a lot of testing. Different phones have different touch sensitivity. In the end, I used adaptive thresholds that adjust based on the first few inputs.
Six directions change everything
Switching from squares to hexagons touched every system in the game: movement, collision, input and drawing. A small change in geometry spread everywhere.
How the game feels matters more than technical correctness. The swipe controls went through dozens of versions. Each one worked, but felt wrong. Finding the right response took trial and error.
Changing a limit leads to new ideas. The four directions of classic Snake seemed random until I removed them. With six directions, I had to rethink strategies I had always taken for granted.
Interested in working together? Check out my services and pricing to see how we can collaborate on your next project. Let's Build