Fixed monster z-fighting.
This commit is contained in:
parent
17008871ce
commit
24db632470
4
TODO.md
4
TODO.md
@ -8,8 +8,8 @@
|
||||
- [ ] Change layout when playing in portrait mode.
|
||||
- [X] Fix wobble animation.
|
||||
- [ ] Add more unit tests?
|
||||
- [ ] Fix z-fighting of monsters.
|
||||
- [ ] Add exploding animation of monsters.
|
||||
- [X] Fix z-fighting of monsters.
|
||||
- [X] Add exploding animation of monsters.
|
||||
- [ ] Add audio settings (music & sound volume).
|
||||
- [X] Hearts must be saved as well for resume.
|
||||
- [ ] Add demo mode.
|
||||
|
@ -338,7 +338,13 @@ func (r levelController) Render(ctx ui.Context) {
|
||||
renderer.DrawTexturePoint(player, playerPosition.Add(centerTopSquare))
|
||||
}
|
||||
|
||||
for pos, monsterType := range r.Level.Monsters {
|
||||
for y := r.Level.Bounds.Min.Y; y < r.Level.Bounds.Max.Y; y++ {
|
||||
for x := r.Level.Bounds.Min.X; x < r.Level.Bounds.Max.X; x++ {
|
||||
pos := geom.Pt(x, y)
|
||||
monsterType, ok := r.Level.Monsters[pos]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
tile := r.Level.Tiles[pos]
|
||||
if tile == nil {
|
||||
continue
|
||||
@ -356,6 +362,7 @@ func (r levelController) Render(ctx ui.Context) {
|
||||
texture.Draw(renderer, platformPos.Add(propOffset), r.Animations["monster"].Frame(pos))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var died []geom.Point
|
||||
for pos, monster := range r.DyingMonsterTypes {
|
||||
|
Loading…
Reference in New Issue
Block a user