This commit is contained in:
Josh Deprez 2021-09-01 09:55:18 +10:00
parent 77435b7c20
commit 01752b77d9
2 changed files with 2 additions and 3 deletions

View file

@ -40,8 +40,7 @@ func (c *Camera) Prepare(game *Game) error {
} }
// Transform returns the camera transform. // Transform returns the camera transform.
func (c *Camera) Transform() ebiten.DrawImageOptions { func (c *Camera) Transform() (opts ebiten.DrawImageOptions) {
var opts ebiten.DrawImageOptions
opts.GeoM.Translate(float2(c.Centre.Mul(-1))) opts.GeoM.Translate(float2(c.Centre.Mul(-1)))
opts.GeoM.Scale(c.Zoom, c.Zoom) opts.GeoM.Scale(c.Zoom, c.Zoom)
opts.GeoM.Rotate(c.Rotation) opts.GeoM.Rotate(c.Rotation)

View file

@ -25,7 +25,7 @@ var (
// Wall is a more flexible kind of tilemap. WallUnits can be added at the same // Wall is a more flexible kind of tilemap. WallUnits can be added at the same
// level as other components and are responsible for their own drawing, so that // level as other components and are responsible for their own drawing, so that
// Scene can do draw ordering, e.g. hide the player character behind a wall. // Game can do draw ordering, e.g. hide the player character behind a wall.
// But Wall is still responsible for collisions. // But Wall is still responsible for collisions.
type Wall struct { type Wall struct {
ID ID