Skip to content

Commit

Permalink
changelog for v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenthepear committed Jun 5, 2024
1 parent 1d16324 commit 756d139
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
18 changes: 10 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

**egriden** is not yet stable, hence the v0.x.x and will introduce breaking changes until v1.

## v0.2.0 - WIP
- Added **levels**, an interface for them and methods for `BaseLevel`. `g.InitEgridenComponents()` now creates a default level.
- Added **free layers** which allow you to place and draw objects anywhere on the screen according to their XY coordinates.
- Added methods for deleting and moving Gobjects within a grid layer: `l.DeleteAt()`, `l.MoveGobjectTo()`.
- Added `DrawOptions` field and methods for SpritePacks, allowing you to customize rendering of sprites using `ebiten.DrawImageOptions`. You can now also apply offsets for sprites with the new `o.SetDrawOffets()` method.
- Added `l.IsXYwithinBounds()`, `l.IsScreenXYwithinBounds()`, `ScreenXYtoGrid()`, `SnapScreenXYtoCellAnchor()` to make interactions between the screen (cursor) and grid layers easier.
- Removed `baseGobjectWithoutScripts`, you can use the new `OnDrawFunc` and `OnUpdateFunc` fields to assign scripts, which are nil by default.
## v0.2.0 "Liberty" - 2024-05-06
- Added [**free layers**](ttps://pkg.go.dev/github.com/greenthepear/egriden#FreeLayer) which allow you to place and draw objects anywhere on the screen according to their XY coordinates.
- Added **levels**, an interface for them and methods for [`BaseLevel`](https://pkg.go.dev/github.com/greenthepear/egriden#BaseLevel). [`(*EgridenAssets).InitEgridenAssets()`](https://pkg.go.dev/github.com/greenthepear/egriden#EgridenAssets.InitEgridenAssets) now creates a default level.
- `(*EgridenAssets).InitEgridenAssets()` was renamed from `(*EgridenAssets).InitEgridenComponents()`.
- Added methods for deleting and moving Gobjects within a grid layer: [`(*GridLayer).DeleteAt()`](https://pkg.go.dev/github.com/greenthepear/egriden#GridLayer.DeleteAt), [`(*GridLayer).MoveGobjectTo()`](https://pkg.go.dev/github.com/greenthepear/egriden#GridLayer.MoveGobjectTo).
- Added [`(SpritePack).DrawOptions`](https://pkg.go.dev/github.com/greenthepear/egriden#SpritePack.DrawOptions) field and [`(Gobject).SetDrawOptions`](https://pkg.go.dev/github.com/greenthepear/egriden#Gobject.SetDrawOptions) method, allowing you to customize rendering of sprites using `ebiten.DrawImageOptions`. You can now also apply offsets for sprites with the new [`(Gobject).SetDrawOffsets()`](https://pkg.go.dev/github.com/greenthepear/egriden#Gobject.SetDrawOffsets) method.
- Added [`(GridLayer).IsXYwithinBounds()`](https://pkg.go.dev/github.com/greenthepear/egriden#GridLayer.IsXYwithinBounds), [`(GridLayer).IsScreenXYwithinBounds()`](https://pkg.go.dev/github.com/greenthepear/egriden#GridLayer.IsScreenXYwithinBounds), [`ScreenXYtoGrid()`](https://pkg.go.dev/github.com/greenthepear/egriden#ScreenXYtoGrid) and [`SnapScreenXYtoCellAnchor()`](https://pkg.go.dev/github.com/greenthepear/egriden#SnapScreenXYtoCellAnchor) to make interactions between the screen (cursor) and grid layers easier.
- Removed `baseGobjectWithoutScripts`, you can use the new [`(BaseGobject).OnDrawFunc`](https://pkg.go.dev/github.com/greenthepear/egriden#BaseGobject.OnDrawFunc) and [`(BaseGobject).OnUpdateFunc`](https://pkg.go.dev/github.com/greenthepear/egriden#BaseGobject.OnUpdateFunc) fields to assign scripts, which are nil by default.
- Made layer selection methods return nil instead of panicing if z is out of bounds.
- Renamed `l.AddObject` to `l.AddGobject`.
- Renamed `(*GridLayer).AddObject` to [`(*GridLayer).AddGobject`](https://pkg.go.dev/github.com/greenthepear/egriden#GridLayer.AddGobject).
- More tests and bug fixes.
- "Updated" to go v1.22.3 and Ebitengine v2.7.3.
- Updated localization files.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
func main(){
//Initialize
g := &Game{}
g.InitEgridenComponents()
g.InitEgridenAssets()

layer0 := g.CreateGridLayerOnTop(
"Background", //Name
Expand Down
2 changes: 1 addition & 1 deletion examples/gridsweeper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {

func main() {
g := &Game{}
g.InitEgridenComponents()
g.InitEgridenAssets()
lbg := g.CreateGridLayerOnTop("Background",
defGridLen, defGridWidth, defGridHeight, egriden.Static, 0, 0)
lbo := g.CreateGridLayerOnTop("Bombs",
Expand Down
2 changes: 1 addition & 1 deletion freelayer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

func TestFreeLayers(t *testing.T) {
g := EgridenAssets{}
g.InitEgridenComponents()
g.InitEgridenAssets()

testoffx, testoffy := 10.0, 20.0
fl1 := g.CreateFreeLayerOnTop("freelayer1", testoffx, testoffy)
Expand Down
6 changes: 5 additions & 1 deletion game.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package egriden

// Egriden components to be embedded in your Game{} struct.
//
// You need to run []
type EgridenAssets struct {
Levels []Level
CurrentLevelIndex int
Expand Down Expand Up @@ -48,10 +51,11 @@ func (g *EgridenAssets) NextLevel() {
}

// Run this while initializing the game, before adding any layers. Creates a level called `Default`
func (g *EgridenAssets) InitEgridenComponents() {
func (g *EgridenAssets) InitEgridenAssets() {
g.AddLevel(NewBaseLevel("Default"))
}

// UNTESTED! Run all the onUpdate() functions of Gobjects that have them within the current level
func (g *EgridenAssets) RunUpdateScripts() {
g.Level().(*BaseLevel).RunUpdateScripts()
}
2 changes: 1 addition & 1 deletion level.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (le *BaseLevel) DrawAllFreeLayers(on *ebiten.Image) {
}
}

// Run all the onUpdate() functions of Gobjects that have them
// UNTESTED! Run all the onUpdate() functions of Gobjects that have them
func (le *BaseLevel) RunUpdateScripts() {
marked := 0
for _, o := range le.gobjectsWithUpdateScripts {
Expand Down
2 changes: 1 addition & 1 deletion levelslayers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

func TestLevelsLayersGobjects(t *testing.T) {
g := &EgridenAssets{}
g.InitEgridenComponents()
g.InitEgridenAssets()

l := g.CreateGridLayerOnTop("test", 16, 10, 12, Sparce, 0, 0)
if l != g.GridLayer(0) {
Expand Down

0 comments on commit 756d139

Please sign in to comment.