func (sp *Space) Resize(width, height int) {
	sp.Cells = [][]*Cell{}
	for y := 0; y < height; y++ {
		sp.Cells = append(sp.Cells, []*Cell{})
		for x := 0; x < width; x++ {
			sp.Cells[y] = append(sp.Cells[y], newCell(x, y))
		}
	}
}
Resize resizes the internal Cells array.
package resolv
import (
	"math"
	"github.com/kvartborg/vector"
)
type Space struct {
	Cells                 [][]*Cell
	CellWidth, CellHeight int  
}
func NewSpace(spaceWidth, spaceHeight, cellWidth, cellHeight int) *Space {
	sp := &Space{
		CellWidth:  cellWidth,
		CellHeight: cellHeight,
	}
	sp.Resize(spaceWidth/cellWidth, spaceHeight/cellHeight)
	return sp
}
func (sp *Space) Add(objects ...*Object) {
	for _, obj := range objects {
		obj.Space = sp
		obj.Update()
	}
}
func (sp *Space) Remove(objects ...*Object) {
	for _, obj := range objects {
		for _, cell := range obj.TouchingCells {
			cell.unregister(obj)
		}
		obj.TouchingCells = []*Cell{}
		obj.Space = nil
	}
}
func (sp *Space) Objects() []*Object {
	objectsAdded := map[*Object]bool{}
	objects := []*Object{}
	for cy := range sp.Cells {
		for cx := range sp.Cells[cy] {
			for _, o := range sp.Cells[cy][cx].Objects {
				if _, added := objectsAdded[o]; !added {
					objects = append(objects, o)
					objectsAdded[o] = true
				}
			}
		}
	}
	return objects
}