Unity hex grids 1: Creating your first hex grid

May 10, 2016 9:30 pm Published by

Today I'm going to attempt to create a 2d hexagonal grid in Unity, going through the steps required in depth and explaining the code involved (for my sake more than anyone else!) Whenever you see a link, click it to visualise the process, or change between pointy topped and flat topped hexagons

Why Hexagons?

Many games use square grids due to how easy they can be to create and manage, but they do have a number of shortcomings. Namely, the diagonal distance between two squares on a grid is different from the horizontal and vertical distances. You either have to code especially for these circumstances or disallow diagonal movement in your game entirely. Hexagon grids are more difficult to initially set up, but once you've overcome this hurdle your movement code is a lot easier.

Html5 canvas game development: setting up a canvas

February 6, 2015 4:05 pm Published by

This is the start of my tutorial series on html5 canvas game development using the canvas element. It’s a bit of a refresher for me in the subject, as it’s been a while since I’ve done this myself. Step 1: Don’t Give Up In my opinion the best part of developing anything for the web is loading your browser and viewing your creation. Depending on what you see, however, this can also be the worst part of being a developer, but let’s be hopelessly optimistic here! In order to view your images and assets, you will need to first set up a canvas element. True to it’s name, this is the equivalent of an artist’s canvas, a bitmap object that you can “paint” on and is specially optimised by the browser to be constantly refreshed and updated. You can choose to simply create the canvas in html: 1 <canvas class="artboard"... Read the full article