diff options
Diffstat (limited to 'ecs/gameobject.go')
| -rw-r--r-- | ecs/gameobject.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ecs/gameobject.go b/ecs/gameobject.go index a2718c3..86429d7 100644 --- a/ecs/gameobject.go +++ b/ecs/gameobject.go @@ -1,10 +1,14 @@ package ecs -import "github.com/Zyko0/go-sdl3/sdl" +import ( + "fmt" + "github.com/Zyko0/go-sdl3/sdl" +) type GameObject struct { - Position sdl.FPoint - Children []IsGameObject + Position sdl.FPoint + Children []IsGameObject + Components []Component } func (g *GameObject) GO() *GameObject { @@ -14,3 +18,9 @@ func (g *GameObject) GO() *GameObject { type IsGameObject interface { GO() *GameObject } + +func (g *GameObject) Safe(err error) { + if err != nil { + fmt.Printf("%v\n", err.Error()) + } +} |
