project-ely/internal/game/camera.go

16 lines
400 B
Go

package game
import "github.com/veandco/go-sdl2/sdl"
// camera represents a view of the world. It's a projection through the window looking at the world.
// Since this is only a 2D game with SDL, the projection is relatively simple: window + camera = world.
// https://gamedev.stackexchange.com/a/123844
type camera struct {
pos sdl.Point
}
func NewCamera() *camera {
c := camera{}
return &c
}