ScratchData LogoScratchData
Back to -Jie-'s profile

Hexagonal Grid Engine

-J-Jie-•Created June 28, 2014
Hexagonal Grid Engine
162
123
2675 views
View on Scratch

Instructions

This project contains very useful tools for projects involving a hexagonal grid drawn with the pen. This project: * draws a grid of hexagons of any size with a random orientation, * identifies which cell is clicked and changes its color, * is able to find the shortest path between two cells

Description

Feel free to use anything for your own projects. I found the algorithm that identifies the hexagon cell from x, y coordinates on: http://www.redblobgames.com/grids/hexagons/ I actually spent hours trying to work out the algorithm on my own, but it proved to be a bit too hard for me, so I just implemented it without understanding it. The algorithm for finding the shortest path is a simple implementation of the A* algorithm http://en.wikipedia.org/wiki/A*_search_algorithm

Project Details

Project ID24148560
CreatedJune 28, 2014
Last ModifiedFebruary 7, 2015
SharedFebruary 6, 2015
Visibilityvisible
CommentsAllowed