Moveable viewport. Absolute positioning (for UI etc) is possible. Added distance-based bounder for projectiles etc as 'screen' is no longer a suitable bounder. Removed debug msg.

This commit is contained in:
stevenhowes
2022-03-27 17:02:32 +01:00
parent bfa9ab0037
commit 428e2d175c
7 changed files with 88 additions and 24 deletions
+12 -10
View File
@@ -14,16 +14,18 @@ type component interface {
}
type Element struct {
Renderer *sdl.Renderer
Position Vector
Rotation float64
Active bool
Delete bool
Collisions []Circle
components []component
parentElement *Element
ZIndex int
CollisionLayer int
Renderer *sdl.Renderer
Position Vector
SpawnPosition Vector
PositionAbsolute bool
Rotation float64
Active bool
Delete bool
Collisions []Circle
components []component
parentElement *Element
ZIndex int
CollisionLayer int
}
var Elements []*Element