123456789101112131415161718192021222324 |
- package main
- type Camera struct {
- Size *Vec2
- }
- func (c *Camera) debugView(at *Vec2, w *World) string {
- out := ""
- t := at.Clone()
- t.X -= c.Size.X / 2
- t.Y -= c.Size.Y / 2
- for y := range make([]byte, c.Size.Y) {
- for x := range make([]byte, c.Size.X) {
- id := w.Get(uint64(t.X)+uint64(x), uint64(t.Y)+uint64(y))
- if id == 0 {
- out += " "
- } else {
- out += w.TileIndex.Tiles[id].Symbol
- }
- }
- out += "\r\n"
- }
- return out
- }
|