Imps set up torch stands in big rooms on their own ground
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6c16bc7b18
commit
c5378d0774
3 files changed
+122
-12
No files matched your search
+22
-5
@@ -1106,7 +1106,7 @@ impl R3d {
|
||||
for (k, tr) in g.torches.iter().enumerate() {
|
||||
let (x, z) = tr.pos();
|
||||
let fl = 0.85 + 0.1 * (t * 9.0 + k as f32 * 1.7).sin() + 0.05 * (t * 23.0 + k as f32).sin();
|
||||
push(vec3(x, 0.85, z), 5.5, vec3(1.0, 0.62, 0.28), 1.5 * fl, 0.0);
|
||||
push(vec3(x, tr.flame_h() + 0.13, z), 5.5, vec3(1.0, 0.62, 0.28), 1.5 * fl, 0.0);
|
||||
}
|
||||
let (cx, cy) = g.map.core;
|
||||
let hp = (g.core_hp / CORE_HP).clamp(0.0, 1.0);
|
||||
@@ -1304,7 +1304,11 @@ impl R3d {
|
||||
gl_use_default_material();
|
||||
for tr in g.torches.iter().filter(|tr| g.map.shown(tr.wall)) {
|
||||
let (x, z) = tr.pos();
|
||||
draw_cube(vec3(x, 0.55, z), vec3(0.07, 0.3, 0.07), None, Color::from_rgba(70, 45, 28, 255));
|
||||
if tr.stand {
|
||||
draw_torch_stand(x, z);
|
||||
} else {
|
||||
draw_cube(vec3(x, 0.55, z), vec3(0.07, 0.3, 0.07), None, Color::from_rgba(70, 45, 28, 255));
|
||||
}
|
||||
}
|
||||
draw_landmarks_solid(g, t);
|
||||
draw_towers_solid(g);
|
||||
@@ -1328,7 +1332,7 @@ impl R3d {
|
||||
}
|
||||
}
|
||||
for (k, tr) in g.torches.iter().enumerate().filter(|(_, tr)| g.map.shown(tr.wall)) {
|
||||
draw_torch_flame(tr.pos(), k as f32, t);
|
||||
draw_torch_flame(tr.pos(), tr.flame_h(), k as f32, t);
|
||||
}
|
||||
draw_shadows(g);
|
||||
if let Some(f) = g.flag {
|
||||
@@ -2676,10 +2680,23 @@ fn draw_traps_glow(g: &Game, t: f32) {
|
||||
}
|
||||
}
|
||||
|
||||
// a torch on a little iron stand: three splayed legs, a ring and the fire bowl on top
|
||||
fn draw_torch_stand(x: f32, z: f32) {
|
||||
let iron = Color::from_rgba(52, 46, 44, 255);
|
||||
let top = vec3(x, 0.5, z);
|
||||
for k in 0..3 {
|
||||
let a = k as f32 * std::f32::consts::TAU / 3.0 + 0.4;
|
||||
let foot = vec3(x + a.cos() * 0.2, 0.0, z + a.sin() * 0.2);
|
||||
line3(foot, top, 0.03, iron);
|
||||
}
|
||||
draw_cube(vec3(x, 0.26, z), vec3(0.16, 0.025, 0.16), None, iron);
|
||||
draw_cube(vec3(x, 0.55, z), vec3(0.17, 0.09, 0.17), None, Color::from_rgba(70, 58, 50, 255));
|
||||
draw_cube(vec3(x, 0.6, z), vec3(0.12, 0.02, 0.12), None, Color::from_rgba(255, 140, 40, 255));
|
||||
}
|
||||
|
||||
// a torch flame: stacked glowing blocks, hot and white at the bottom, red at the tip, that
|
||||
// sway and flicker; a soft halo around it (the smoke comes from particles.rs)
|
||||
fn draw_torch_flame((x, z): (f32, f32), k: f32, t: f32) {
|
||||
let base = 0.72;
|
||||
fn draw_torch_flame((x, z): (f32, f32), base: f32, k: f32, t: f32) {
|
||||
let flick = 0.8 + 0.2 * (t * 13.0 + k * 2.1).sin() + 0.1 * (t * 29.0 + k * 0.7).sin();
|
||||
draw_sphere(vec3(x, base + 0.1, z), 0.24 * flick, None, Color::new(1.0, 0.55, 0.15, 0.16));
|
||||
let n = 6;
|
||||
|
||||
Reference in new issue
Block a user