GithubHelp home page GithubHelp logo

godot-grid's Introduction

grid

godot-grid

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.

Preview

Make patterns:

Easily work with Columns, Rows and Diagonals:

Clusters and Collision:

Tutorial (to see all Features)

Applications

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
  • ...

Performance

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 in Grid.tiles, because putting Nodes requires the use of Nodes.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

Installation

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!

Future Feature Ideas

  • support for hex grid
  • support for triangular grid
  • support for isometric grid
  • you can open an issue if you're missing a feature

Attributions

Menu icons created by Kiranshastry - Flaticon

godot-grid's People

Contributors

amopel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.