ichigo/engine/solid.go

22 lines
264 B
Go
Raw Normal View History

2021-08-03 14:56:53 +10:00
package engine
import (
"encoding/gob"
"image"
)
2021-08-18 16:34:51 +10:00
var _ Collider = SolidRect{}
2021-08-03 14:56:53 +10:00
func init() {
2021-08-25 15:04:38 +10:00
gob.Register(&SolidRect{})
2021-08-03 14:56:53 +10:00
}
type SolidRect struct {
2021-08-03 16:48:21 +10:00
ID
2021-08-23 10:34:56 +10:00
Bounds
2021-08-03 14:56:53 +10:00
}
2021-09-01 09:17:08 +10:00
func (s SolidRect) CollidesWith(r image.Rectangle) bool {
return s.BoundingRect().Overlaps(r)
}