doodle/types/types.go
Noah Petherbridge 27fafdc96d Save and restore maps as JSON files
First pass at a level storage format to save and restore maps.

To save a map: press F12. It takes a screenshot PNG into the
screenshots/ folder and outputs a map JSON in the working directory.

To restore a map: "go run cmd/doodle/main.go map.json"
2018-06-17 10:31:44 -07:00

14 lines
201 B
Go

package types
import "fmt"
// Point is a 2D point in space.
type Point struct {
X int32 `json:"x"`
Y int32 `json:"y"`
}
func (p Point) String() string {
return fmt.Sprintf("(%d,%d)", p.X, p.Y)
}