{"id":13402382,"url":"https://github.com/vonWolfehaus/von-grid","last_synced_at":"2025-03-14T07:32:49.035Z","repository":{"id":27211838,"uuid":"30682747","full_name":"vonWolfehaus/von-grid","owner":"vonWolfehaus","description":"Hexagonal \u0026 square tile grid system with three.js","archived":true,"fork":false,"pushed_at":"2021-06-15T06:56:23.000Z","size":3302,"stargazers_count":383,"open_issues_count":4,"forks_count":73,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-07-31T19:35:36.745Z","etag":null,"topics":["2d","3d","game-library","grid-system","hex-grid","hexagon","javascript","threejs","tile-engine","tilemap"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vonWolfehaus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-12T03:05:48.000Z","updated_at":"2024-06-24T08:41:42.000Z","dependencies_parsed_at":"2022-07-17T14:47:03.001Z","dependency_job_id":null,"html_url":"https://github.com/vonWolfehaus/von-grid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonWolfehaus%2Fvon-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonWolfehaus%2Fvon-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonWolfehaus%2Fvon-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonWolfehaus%2Fvon-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vonWolfehaus","download_url":"https://codeload.github.com/vonWolfehaus/von-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243542956,"owners_count":20308003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","3d","game-library","grid-system","hex-grid","hexagon","javascript","threejs","tile-engine","tilemap"],"created_at":"2024-07-30T19:01:15.301Z","updated_at":"2025-03-14T07:32:44.021Z","avatar_url":"https://github.com/vonWolfehaus.png","language":"JavaScript","readme":"# NOTE: This repo is no longer maintained\n\nFeel free to fork and do whatever. There is a dev branch that has an incomplete rewrite, but everything here is so old that even I don't get what I was thinking. Enjoy!\n\n# 3D hex tile system\n\n![screenshot](hex-grid.jpg)\n\nI never found a good (and free!) library for creating perfect hexagons and arranging them in a grid. But I did find [Amit's wonderful explanation](http://www.redblobgames.com/grids/hexagons/), and finally had the time to throw something together.\n\nYou can use the `Board` class with different graph types (hex and square), or you can make your own if you implement the interface.\n\nPlease use this to make awesome hex-based web games. Or port the code and make awesome hex games there. Just make awesome hex games, ok?\n\n## Features\n\n- Simple API for attaching objects to the grid through `Board.js`\n- **A* pathfinding** with or without weighted nodes, and a `walkable` flag\n- Make maps with [the editor](http://vonwolfehaus.github.io/von-grid/editor/) (autosaves to localstorage, and save/load as `.json` files)\n- Varied height\n- Sparse maps\n- **Mouse interaction** with the grid's cells (over, out, down, up, click, wheel)\n- Programmatic geometry, allow you to precisely adjust every aspect of the hexagon\n- Square grid that can be used interchangeably\n- Include only the hex grid by downloading `dist/hex-grid.js`, or all grid types with `von-grid.js`, etc\n\n#### Roadmap\n\n- Improved editor\n- Improved API\n- Abstract grid\n\n## Usage\n\n#### Basic board\n\n![screenshot](hex-grid-basic.jpg)\n\n```javascript\nvar scene = new vg.Scene({ // I made a very handy util for creating three.js scenes quickly\n\tcameraPosition: {x:0, y:150, z:150}\n}, true); // 'true' or a config object adds orbit controls\n\nvar grid = new vg.HexGrid();\n\ngrid.generate({\n\tsize: 4\n});\n\nvar board = new vg.Board(grid);\n\nboard.generateTilemap();\n\nscene.add(board.group);\nscene.focusOn(board.group);\n\nupdate();\n\nfunction update() {\n\tscene.render();\n\trequestAnimationFrame(update);\n}\n```\n\n#### Examples\n\nFor the simple examples you can drop them into Chrome, but for ones that require images or models, you'll have to run `gulp serve-examples`. A browser tab will be opened to the examples directory for you.\n\n## Editor\n\n#### [Try it out](http://vonwolfehaus.github.io/von-grid/editor/)\n\n![screenshot](editor.png)\n","funding_links":[],"categories":["JavaScript","3d"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FvonWolfehaus%2Fvon-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FvonWolfehaus%2Fvon-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FvonWolfehaus%2Fvon-grid/lists"}