slight fixes

This commit is contained in:
2019-11-01 22:01:23 +03:00
parent 17ef52a5cf
commit 8c428838d6
5 changed files with 35 additions and 29 deletions

View File

@ -56,11 +56,11 @@ func (vp *ViewPort) Move(state *gamestate.GameState) {
if y < 0 {
y = 0
}
if x > state.Level.W-vp.W - 1 {
x = state.Level.W - vp.W - 1
if x > state.Level.W - vp.W - 1 {
x = state.Level.W - vp.W
}
if y > state.Level.H-vp.H - 1 {
y = state.Level.H - vp.H - 1
y = state.Level.H - vp.H
}
if x != vp.cameraCoords.X || y != vp.cameraCoords.Y {
state.FovRecompute <- struct{}{}