Seasons: snow above ground in winter, glowing pumpkins at Halloween
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
95f9512b83
commit
74837f1c34
3 files changed
+62
-2
No files matched your search
+21
@@ -91,6 +91,8 @@ pub const T_GRASS: u32 = 204; // 4 variants: grass above ground
|
||||
pub const I_WALL: u32 = 208; // wall tool: bricks rising from the floor
|
||||
pub const I_RAM: u32 = 209; // battering ram tool
|
||||
pub const I_CATAPULT: u32 = 210; // catapult tool
|
||||
pub const T_SNOW: u32 = 211; // 4 variants: snow on the land above ground (winter)
|
||||
pub const T_PUMPKIN: u32 = 215; // a carved pumpkin (Halloween)
|
||||
|
||||
pub struct Gfx {
|
||||
pub atlas: Texture2D,
|
||||
@@ -914,6 +916,25 @@ fn gen_atlas() -> Image {
|
||||
Some(if r % 5 == 0 { c(14, 40, 30) } else if r % 7 == 0 { c(52, 96, 62) } else if v == 0 { c(26, 64, 44) } else { c(32, 72, 40) })
|
||||
});
|
||||
}
|
||||
// snow above ground in winter
|
||||
for v in 0..4u32 {
|
||||
cv.cell(T_SNOW + v, |x, y| {
|
||||
let r = hash(x, y, 450 + v);
|
||||
Some(if r % 9 == 0 { c(214, 222, 236) } else if r % 23 == 0 { c(150, 170, 120) } else { c(236, 240, 248) })
|
||||
});
|
||||
}
|
||||
// a carved pumpkin: orange ribs, a grinning face
|
||||
cv.cell(T_PUMPKIN, |x, y| {
|
||||
let eye = (y == 5 || y == 6) && (x == 4 || x == 5 || x == 10 || x == 11);
|
||||
let mouth = (y == 10 && (3..=12).contains(&x)) || (y == 11 && (5..=10).contains(&x) && x % 2 == 0);
|
||||
if eye || mouth {
|
||||
Some(c(255, 230, 90))
|
||||
} else if x % 4 == 0 {
|
||||
Some(c(190, 90, 20))
|
||||
} else {
|
||||
Some(c(240, 128, 30))
|
||||
}
|
||||
});
|
||||
// grass above ground
|
||||
for v in 0..4u32 {
|
||||
cv.cell(T_GRASS + v, |x, y| {
|
||||
|
||||
Reference in new issue
Block a user