Lighting experiments

This commit is contained in:
2025-12-16 00:44:52 -07:00
parent c70f85abe5
commit de5f47f47b
12 changed files with 664 additions and 17 deletions

View File

@@ -90,6 +90,10 @@ type Hero struct {
lastAnimKey animationKey
ProjectileConfig projectile.ProjectileConfig
// Lighting state
InShadow bool
ShadowIntensity float64
}
type Config struct {
@@ -358,6 +362,11 @@ func (h *Hero) Draw(screen *ebiten.Image) {
// no color modification for idle
}
if h.InShadow {
darkness := 1.0 - h.ShadowIntensity
op.ColorScale.Scale(float32(darkness), float32(darkness), float32(darkness), 1.0)
}
op.Filter = ebiten.FilterNearest
screen.DrawImage(sprite, op)
}