func bodyPlanTreeToCellGrid(n *bodyPlanNode, depth int) micro.CellGrid { // TODO gridSize := 2*depth - 1 centerPos := gridSize / 2 g := micro.NewCellGrid(gridSize, gridSize) mapBodyPlanNodeToGrid(n, &g, centerPos, centerPos) return g }
func NewBug(x, y int) *Bug { w := 3 h := 3 g := micro.NewCellGrid(w, h) g[1][0] = µ.Cell{Type: micro.CellTypeAttack, Value: 127} g[0][1] = µ.Cell{Type: micro.CellTypeAttack, Value: 127} g[1][1] = µ.Cell{Type: micro.CellTypeAbsorb, Value: 127} g[2][1] = µ.Cell{Type: micro.CellTypeAttack, Value: 127} g[1][2] = µ.Cell{Type: micro.CellTypeAttack, Value: 127} return &Bug{ Body: g, width: w, height: h, xpos: x, ypos: y, Energy: 100, // TODO } }