12345678910111213141516171819202122232425262728293031323334 |
- package main
- import (
- . "current/gen"
- //"fmt"
- "image/png"
- "os"
- )
- var Root = NewMap(1000).
- Def(
- "dirt",
- Rgba{0, 1, 0, 1},
- N("dirt", 40),
- N("sand", 3),
- ).Def(
- "sand",
- Rgba{1, 0, 0, 1},
- N("sand", 7),
- N("water", 5),
- N("dirt", 3),
- ).Def(
- "water",
- Rgba{0, 0, 1, 1},
- N("water", 17),
- N("sand", 3),
- )
- func main() {
- Root.FillFromUpLeft("water")
- img := Root.Render()
- f, _ := os.Create("img.png")
- png.Encode(f, img)
- }
|