ichigo/engine/solid.go
2021-09-01 09:17:08 +10:00

21 lines
264 B
Go

package engine
import (
"encoding/gob"
"image"
)
var _ Collider = SolidRect{}
func init() {
gob.Register(&SolidRect{})
}
type SolidRect struct {
ID
Bounds
}
func (s SolidRect) CollidesWith(r image.Rectangle) bool {
return s.BoundingRect().Overlaps(r)
}