ichigo/engine/solid.go

21 lines
229 B
Go
Raw Normal View History

2021-08-03 14:56:53 +10:00
package engine
import (
"encoding/gob"
)
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-09-02 20:17:45 +10:00
Box
2021-08-03 14:56:53 +10:00
}
2021-09-02 20:17:45 +10:00
func (s SolidRect) CollidesWith(r Box) bool {
return s.Box.Overlaps(r)
2021-09-01 09:17:08 +10:00
}