func NewTile(kind TileKind, w *World, x, y int) Tile { return Tile{ Kind: kind, W: w, X: x, Y: y, Entities: *NewEntitySet(), aabb: d2.Rect( (float32(x)-0.5)/w.GridScale, (float32(y)-0.5)/w.GridScale, (float32(x)+0.5)/w.GridScale, (float32(y)+0.5)/w.GridScale, ), } }
func (cm *CoffeeMachine) Rectangle() d2.Rectangle { x, y := cm.pos[0], cm.pos[1] return d2.Rect(x-0.25, y-0.25, x+0.25, y+0.25) }
func (bb *BuildingBase) Rectangle() d2.Rectangle { x, y := bb.pos.X(), bb.pos.Y() return d2.Rect(x-0.25, y-0.25, x+0.25, y+0.25) }