2019-05-02 01:30:30 +00:00
|
|
|
package doodads
|
|
|
|
|
|
|
|
import (
|
2022-09-24 22:17:25 +00:00
|
|
|
"git.kirsle.net/SketchyMaze/doodle/pkg/level"
|
2019-12-28 03:16:34 +00:00
|
|
|
"git.kirsle.net/go/render"
|
2019-05-02 01:30:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// NewDummy creates a placeholder dummy doodad with a giant "X" across it.
|
|
|
|
func NewDummy(size int) *Doodad {
|
|
|
|
dummy := New(size)
|
|
|
|
|
|
|
|
red := &level.Swatch{
|
|
|
|
Color: render.Red,
|
|
|
|
Name: "missing color",
|
|
|
|
}
|
|
|
|
dummy.Palette.Swatches = []*level.Swatch{red}
|
|
|
|
|
|
|
|
for i := 0; i < size; i++ {
|
2019-12-28 03:16:34 +00:00
|
|
|
left := render.NewPoint(i, i)
|
|
|
|
right := render.NewPoint(size-i, i)
|
2019-05-02 01:30:30 +00:00
|
|
|
|
|
|
|
// Draw the stroke 2 pixels thick
|
|
|
|
dummy.Layers[0].Chunker.Set(left, red)
|
|
|
|
dummy.Layers[0].Chunker.Set(right, red)
|
|
|
|
left.Y++
|
|
|
|
right.Y++
|
|
|
|
dummy.Layers[0].Chunker.Set(left, red)
|
|
|
|
dummy.Layers[0].Chunker.Set(right, red)
|
|
|
|
}
|
|
|
|
|
|
|
|
return dummy
|
|
|
|
}
|