BlueGit

timfa questward

Files

questward / client / scripts / tree-sprites / shapes / birch.mjs

birch.mjs

birch.mjs 777 B Download Raw
1import { drawTrunk, fillEllipse, fillRect, setPixel } from "../common.mjs";
2
3const BARK = Object.freeze([210, 198, 168, 255]);
4const BARK_STREAK = Object.freeze([238, 234, 222, 255]);
5const BARK_MARK = Object.freeze([72, 58, 46, 255]);
6
7/** Tall pale birch — narrow oval crown, white bark streak. */
8export function drawBirchCanopy (image, season, stump, foliage)
9{
10 drawTrunk(image, 16, 26, 44, 2);
11 fillRect(image, 15, 26, 2, 18, BARK);
12 fillRect(image, 15, 28, 1, 14, BARK_STREAK);
13 for (const y of [31, 35, 39])
14 {
15 setPixel(image, 15, y, BARK_MARK);
16 setPixel(image, 16, y, BARK_MARK);
17 }
18
19 fillEllipse(image, 16, 13, 5, 12, foliage);
20 fillEllipse(image, 16, 5, 3, 4, foliage);
21 fillEllipse(image, 11, 15, 2, 5, foliage);
22 fillEllipse(image, 21, 15, 2, 5, foliage);
23}