summaryrefslogtreecommitdiff
path: root/engine/CoreObjects/DynamicObject.go
blob: 9e1d48b54f7d378a70d3213088d3d82c1a269fc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package coreobjects

import rl "github.com/gen2brain/raylib-go/raylib"

// An object loaded from the package. Impmiments GameObject interface
type DynamicObject struct {
	Position rl.Vector2
	Textures []*TextureBlock
}

// The dynamic objects can contain multiple textures. This struct
// represents one of those parts
type TextureBlock struct {
	Texture *rl.Texture2D
	Offset rl.Vector2
}

func (base *DynamicObject) Create(SceneManager) {
}

func (base *DynamicObject) Destroy() {
}

func (base *DynamicObject) Update() {
}

func (base *DynamicObject) Draw() {
	for _, v := range base.Textures {
		rl.DrawTexture(*v.Texture, 
			int32(base.Position.X + v.Offset.X),
			int32(base.Position.Y + v.Offset.Y),
			rl.White)
	}
}