From eb79fdeedc0da9a05f5c7b43e523751a92e02438 Mon Sep 17 00:00:00 2001 From: surdeus Date: Fri, 17 Feb 2023 14:47:17 +0500 Subject: [PATCH] ... --- src/gx/object.go | 21 +++++++++++++++++++++ src/gx/sprite.go | 3 +++ src/gx/transform.go | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 src/gx/object.go create mode 100644 src/gx/sprite.go create mode 100644 src/gx/transform.go diff --git a/src/gx/object.go b/src/gx/object.go new file mode 100644 index 0000000..4344ba8 --- /dev/null +++ b/src/gx/object.go @@ -0,0 +1,21 @@ +package gx + +type Behaver interface { + Start() + Update() + GetObject() *Object +} + +// The object type represents +// basic information for interaction +// with the engine. +type Object struct { + T Transform +} + +func (o *Object) Start() {} +func (o *Object) Update() {} +func (o *Object) GetObject() *Object { + return o +} + diff --git a/src/gx/sprite.go b/src/gx/sprite.go new file mode 100644 index 0000000..ca27035 --- /dev/null +++ b/src/gx/sprite.go @@ -0,0 +1,3 @@ +package gx + + diff --git a/src/gx/transform.go b/src/gx/transform.go new file mode 100644 index 0000000..6432c32 --- /dev/null +++ b/src/gx/transform.go @@ -0,0 +1,20 @@ +package gx + +type Float float64 + +type Vector struct { + X, Y Float +} + +type Transform struct { + // Position, scale, rotate around. + P, S, RA Vector + // Rotation angle in radians. + R Float +} + +func T() Transform { + ret := Transform{} + return ret +} +