Skip to content

v0.2.1 Patch

Latest
Compare
Choose a tag to compare
@greenthepear greenthepear released this 15 Jun 15:17
· 21 commits to main since this release

Small patch to make working with pointers easier, also a new little example!

Check out CHANGELOG.md and https://pkg.go.dev/github.com/greenthepear/egriden.

Changes:

  • Changed signature of (Gobject).OnDrawFunc and (Gobject).OnUpdateFunc functions by adding a self Gobject parameter. This removes confusing pointer stuff that happens when you want to make a BaseGobject with custom functions like so:
    o := NewBaseGobject(...)
    o.OnDrawFunc = func (i *ebiten.Image, l Layer) {
        o.NextFrame() //Won't do anything!
        //Just changes the frame of the original gobject 'template' which will
        //not be running in the game, since that's what o points to.
        o.DrawSprite(i, l)
    }
    l.AddGobject(o.Build(), 0, 0)
    • Also added a l Layer parameter to (Gobject).OnUpdateFunc for convenience. Getting the object's layer pointer into the OnUpdate function was tricky beforehand.
  • Fixed the small issue that (Gobject).OnUpdate would never run ever.
  • Added a new simple example gopher-party to showcase many things added in v0.2.0 and this patch.
  • Updated Ebitengine to v2.7.5.
  • Updated localization files.