示例#1
0
文件: imp.go 项目: CaptainSoOmA/Uni
func (X *Imp) Write(l, c uint) {
	//
	r := rep[X.nr]
	switch format {
	case Short:
		switch system {
		case Life:
			f, b := r.cf[X.mark], r.cb[X.mark]
			if X.nr == nothing {
				f, b = b, f
			}
			x, y := int(8*c)+8, int(16*l)+8
			scr.Colour(f)
			scr.Circle(x, y, 6)
			scr.Circle(x, y, 5)
			scr.Colour(b)
			scr.CircleFull(x, y, 2)
		case Eco:
			for y := 0; y < Height; y++ {
				for x := 0; x < Width; x++ {
					f, b := r.cf[X.mark], r.cb[X.mark] // !
					if r.img[y][x] == ' ' {
						f, b = b, f
					}
					scr.Colours(f, b)
					scr.Point(Width*int(c)/2+x, Height*int(l)+y)
				}
			}
		}
	case Long:
		scr.Colour(r.cf[plantNothing])
		scr.Write(r.word, l, c)
	}
}
示例#2
0
文件: imp.go 项目: CaptainSoOmA/Uni
func draw(right bool, c col.Colour, X, Y int) {
	//
	scr.Lock()
	for y := 0; y < H; y++ {
		for x := 0; x < W; x++ {
			if car[y][x] == '*' {
				scr.Colour(c)
			} else {
				scr.Colour(col.ScreenB)
			}
			if right {
				scr.Point(X+x, Y+y)
			} else {
				scr.Point(X+W-1-x, Y+y)
			}
		}
	}
	scr.Unlock()
}