Fixed lighting

This commit is contained in:
2025-12-16 09:13:22 -07:00
parent de5f47f47b
commit 32df388c77
6 changed files with 85 additions and 66 deletions

View File

@@ -91,9 +91,7 @@ type Hero struct {
ProjectileConfig projectile.ProjectileConfig
// Lighting state
InShadow bool
ShadowIntensity float64
Brightness float64
}
type Config struct {
@@ -149,6 +147,7 @@ func New(cfg Config) *Hero {
Radius: 4.0,
Color: color.NRGBA{R: 255, G: 0, B: 0, A: 255},
},
Brightness: 1.0,
}
}
@@ -362,9 +361,8 @@ 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)
if h.Brightness < 1.0 {
op.ColorScale.Scale(float32(h.Brightness), float32(h.Brightness), float32(h.Brightness), 1.0)
}
op.Filter = ebiten.FilterNearest