diff --git a/src/cmd/test/main.go b/src/cmd/test/main.go index 121927b..5f5db9d 100644 --- a/src/cmd/test/main.go +++ b/src/cmd/test/main.go @@ -5,7 +5,13 @@ import ( ) type Player struct { - gx.Object + *gx.Object +} + +func NewPlayer() *Player { + return &Player{ + Object: &gx.Object{}, + } } func main() { @@ -15,6 +21,6 @@ func main() { Height: 320, }) - e.Add(0, Player{}) + e.Add(0, NewPlayer()) e.Run() } diff --git a/src/gx/object.go b/src/gx/object.go index ab07de3..31b4dff 100644 --- a/src/gx/object.go +++ b/src/gx/object.go @@ -6,11 +6,6 @@ type Behaver interface { GetObject() *Object } -// The object that is drawn by sprite -/// based on the transform. -type Sprite struct { -} - // The object type represents // basic information for interaction // with the engine. @@ -19,9 +14,9 @@ type Object struct { } // The functions that -func (o Object) Start(e *Engine) {} -func (o Object) Update(e *Engine) {} -func (o Object) GetObject() *Object { - return &o +func (o *Object) Start(e *Engine) {} +func (o *Object) Update(e *Engine) {} +func (o *Object) GetObject() *Object { + return o } diff --git a/src/gx/sprite.go b/src/gx/sprite.go index ca27035..435dd6d 100644 --- a/src/gx/sprite.go +++ b/src/gx/sprite.go @@ -1,3 +1,4 @@ package gx - +type Sprite struct { +}