summaryrefslogtreecommitdiff
path: root/ecs/gameobject.go
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-08-14 12:32:05 +0200
committerewy <ewy0@protonmail.com>2026-08-14 12:32:05 +0200
commit48215d06a6cc0753a839e58c3403d34f69c250d4 (patch)
tree3c391d8edc2e52818072a48c7e36abefeb3b7671 /ecs/gameobject.go
parentbc3f852ea670e206fa3facc736a230f6b9d23920 (diff)
add components in addition to gameobject interfacesHEADmaster
Diffstat (limited to 'ecs/gameobject.go')
-rw-r--r--ecs/gameobject.go16
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())
+ }
+}