A gdscript library to make working with rectangular grids easier.
When to use it:
- You need access to every sprite in the grid and plan to manipulate them by code.
- You want to generate the grid of sprites from code.
When not to use it:
- You don't need to access the tiles from code.
- You want to make the grid from the editor by hand. Use tilemaps for that.
Easily work with Columns, Rows and Diagonals:
Tutorial (to see all Features)
It's supposed to be useful when you have some sort of rectangular grid based system in your game.
- tetris
- chess
- grid based puzzles
- grid based combat
- ...
Since every Tile is a Node (with potential children), you will get lags from 10k Nodes upwards depending on the machine.
So this library is intended for comparativly small Grids.
Some features just use static information and thus are quite fast (the look up tables).
But others generate Arrays depending on the input and can become quite sluggish, with growing dimensions of the grid. See 'Access relative to a Tile' Chapter in the Tutorial
Other Performance Tips:
- make sure to only put
PackedScenes
inGrid.tiles
, because puttingNodes
requires the use ofNodes.duplicate()
which is slow - removing a lot of nodes with
XScene.remove_scene()
, tends to be slow, simply because freeing nodes or detaching them from the tree is expensive
Made with Godot version 3.4.2.stable.official.45eaa2daf
This plugin depends on XScene You have to install it aswell.
This repo is in a Godot Plugin format.
You can:
- Download the .zip of this repo and unpack it into your project, currently XScene is included in the .zip
For more details, read the godot docs on installing Plugins
Don't forget to enable it in your project settings!
- support for hex grid
- support for triangular grid
- support for isometric grid
- you can open an issue if you're missing a feature