{"id":22934166,"url":"https://github.com/greenthepear/egriden","last_synced_at":"2025-08-12T17:32:18.992Z","repository":{"id":227947390,"uuid":"770947691","full_name":"greenthepear/egriden","owner":"greenthepear","description":"Ebitengine framework for creating simple grid-based games","archived":false,"fork":false,"pushed_at":"2024-12-10T17:46:46.000Z","size":168,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-10T19:10:31.003Z","etag":null,"topics":["ebiten","ebitengine","framework","game","gameframework","grid"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greenthepear.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-12T12:33:17.000Z","updated_at":"2024-12-10T17:46:51.000Z","dependencies_parsed_at":"2024-05-05T23:26:42.290Z","dependency_job_id":"a87017f6-1374-4797-af42-164f8b575071","html_url":"https://github.com/greenthepear/egriden","commit_stats":null,"previous_names":["greenthepear/egriden"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenthepear%2Fegriden","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenthepear%2Fegriden/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenthepear%2Fegriden/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenthepear%2Fegriden/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greenthepear","download_url":"https://codeload.github.com/greenthepear/egriden/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229699918,"owners_count":18109851,"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":["ebiten","ebitengine","framework","game","gameframework","grid"],"created_at":"2024-12-14T11:38:44.659Z","updated_at":"2025-08-12T17:32:18.983Z","avatar_url":"https://github.com/greenthepear.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/greenthepear/egriden.svg)](https://pkg.go.dev/github.com/greenthepear/egriden)\n[![Go Report Card](https://goreportcard.com/badge/github.com/greenthepear/egriden)](https://goreportcard.com/report/github.com/greenthepear/egriden)\n\n**egriden** is a framework for the [Ebitengine](https://ebitengine.org/) game engine, perfect for creating simple grid-based puzzle or strategy games. \n\nCurrent features:\n- A **grid layer** system\n- **Levels** (aka scenes) and conventional **free layers**\n- Expandable \"**gobjects**\" with assignable draw and update scripts, which populate the two layer types\n- Animatable **sprite** system with streamlined image loading using glob patterns or yaml files\n\nThere's no abstract grid container for arranging objects to determine the state of your game, instead **the grid is the state**.\n\nIt is an evolution of the messy code base created for [TacZ](https://github.com/greenthepear/TacZ) and is currently used by me to [create games](https://madeby.green).\n\n***Currently unstable!*** Contributions of any kind are welcome. Check [the changelog](CHANGELOG.md) for updates.\n\n# Install\n\nThis is meant to be used **with** (rather than instead of) Ebitengine so follow the [installation guide for Ebitengine](https://ebitengine.org/en/documents/install.html).\n\nIn your go project's directory:\n```\n$ go get github.com/greenthepear/egriden\n```\nor to get the latest development version of this repo:\n```\n$ go get github.com/greenthepear/egriden@main\n```\n\n# Guide\n\nA simple guide of egriden's game structure for drawing based on the [gridsweeper](./examples/gridsweeper/) example:\n\n![guide](./docs/layersguide.png)\n\nEssentially: \n**Levels ∋ Layers ∋ Gobjects ∋ SpritePacks ∋ ImageSequences ∋ Frames** - **Levels** consist of different **layers** which are populated with **Gobjects** which use **SpritePacks** to organize **ImageSequences**, the **frames** of which get shown on the screen.\n\n# Quick boilerplate tutorial\n\n```go\npackage main\n\nimport (\n    \"github.com/greenthepear/egriden\"\n    \"github.com/hajimehoshi/ebiten/v2\"\n)\n\ntype Game struct {\n    egriden.EgridenAssets //Add assets needed for Egriden\n    \n    //Anything else you want here.\n}\n\nfunc (g *Game) Draw(screen *ebiten.Image) {\n    g.DrawAllGridLayers(screen) //Draw layers according to their Z order\n\n    // or do it your way with g.GridLayer(z).Draw()\n}\n\nfunc (g *Game) Update() error {\n    // ... your game logic here\n}\n\nfunc (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {\n    return 320, 320 //Define screen layout\n}\n\nfunc main(){\n    // Initialize\n    g := \u0026Game{}\n    g.InitEgridenAssets()\n\n    layer0 := g.CreateGridLayerOnTop(\n\t\t\"Background\", // Layer name\n\t\tGridLayerParameters{\n\t\t\tGridDimensions: Dimensions{10, 12}, // Logical width and heigh of the grid\n\t\t\tCellDimensions: Dimensions{16, 16}, // Cell size in pixels\n\t\t\tMode:           Sparse, // Draw mode which determines iteration method while drawing\n\t\t},\n\t)\n\n    // Create an image sequence from all the PNGs in a folder\n    // Image sequences are made of frames, controlled by the frame index\n    seq, err := egriden.CreateImageSequenceFromGlob(\"idle\", \"./Graphics/player/idle/*.png\")\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Create SpritePack with the sequence. A sprite pack can have multiple sequences,\n    // which can be switched using their names (keys)\n    playerSprites := egriden.NewSpritePackWithSequence(seq)\n\n    // Create Gobject (short for grid object or go object or game object or whatever\n    // you like) with the ImageSequence\n    goPlayer := egriden.NewBaseGobject(\"player\", playerSprites)\n\n    //Add to layer, Build() method needed for a baseGobject, otherwise create your own\n    //structure for the Gobject interface. You can define update, draw\n    //functions, sprite drawing options and other fun stuff.\n    layer0.AddGobject(goPlayer.Build(), 1, 5)\n\n    //Run the game\n    if err = ebiten.RunGame(g); err != nil {\n        log.Fatal(err)\n    }\n}\n```\n\n# License\nLicensed under the Apache License 2.0 and uses components of Ebitengine by Hajime Hoshi, also licensed under the Apache License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenthepear%2Fegriden","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenthepear%2Fegriden","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenthepear%2Fegriden/lists"}