...
This commit is contained in:
parent
dbd1b50ff7
commit
eb79fdeedc
3 changed files with 44 additions and 0 deletions
21
src/gx/object.go
Normal file
21
src/gx/object.go
Normal file
|
@ -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
|
||||
}
|
||||
|
3
src/gx/sprite.go
Normal file
3
src/gx/sprite.go
Normal file
|
@ -0,0 +1,3 @@
|
|||
package gx
|
||||
|
||||
|
20
src/gx/transform.go
Normal file
20
src/gx/transform.go
Normal file
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in a new issue