doodle/pkg/doodads/dummy/dummy.go
Noah Petherbridge d470f7e647 Collision: Fix walking up leftward slopes
* Actors can now walk up gentle inclines to the left as well as they can
  to the right. The bug was introduced as a hack to prevent clipping
  thru the left wall of a 90 degree corner, but that problem seems
  resolved now.
2021-06-02 21:49:29 -07:00

30 lines
666 B
Go

// Package dummy implements a dummy doodads.Drawing.
package dummy
import (
"git.kirsle.net/apps/doodle/pkg/doodads"
"git.kirsle.net/go/render"
)
// Drawing is a dummy doodads.Drawing that has no data.
type Drawing struct {
Drawing *doodads.Drawing
}
// NewDrawing creates a new dummy drawing.
func NewDrawing(id string, doodad *doodads.Doodad) *Drawing {
return &Drawing{
Drawing: doodads.NewDrawing(id, doodad),
}
}
// Size returns the size of the underlying doodads.Drawing.
func (d *Drawing) Size() render.Rect {
return d.Drawing.Size()
}
// MoveTo changes the drawing's position.
func (d *Drawing) MoveTo(to render.Point) {
d.Drawing.MoveTo(to)
}