GetTile returns a *Tile at the given point (in space / render coordinates).
(pt engo.Point)
| 230 | |
| 231 | // GetTile returns a *Tile at the given point (in space / render coordinates). |
| 232 | func (l *Level) GetTile(pt engo.Point) *Tile { |
| 233 | mp := l.mapPoint(pt) |
| 234 | x := int(math.Floor(mp.X)) |
| 235 | y := int(math.Floor(mp.Y)) |
| 236 | t, ok := l.pointMap[mapPoint{X: x, Y: y}] |
| 237 | if !ok { |
| 238 | return nil |
| 239 | } |
| 240 | return t |
| 241 | } |
| 242 | |
| 243 | // Width returns the integer width of the level |
| 244 | func (l *Level) Width() int { |