Tweak wall collisions
This commit is contained in:
@@ -23,11 +23,14 @@ colCrWall :: World -> Creature -> Creature
|
||||
colCrWall w c
|
||||
| noclipIsOn && _crID c == 0 = c -- for noclip
|
||||
| p1 == p2 = pushOrCrush ls c
|
||||
| otherwise = c & crPos %~
|
||||
| _crPos c' == _crPos c'' = c'
|
||||
| otherwise = c & crPos .~ _crOldPos c
|
||||
where
|
||||
c'' = c & crPos %~ pushOutFromWalls rad ls
|
||||
c' = c & crPos %~
|
||||
pushOutFromWalls rad (reverse ls)
|
||||
. pushOutFromWalls rad ls
|
||||
. flip (collidePointWalls p1) wls -- check push throughs
|
||||
where
|
||||
rad = _crRad c + wallBuffer
|
||||
p1 = _crOldPos c
|
||||
p2 = _crPos c
|
||||
|
||||
Reference in New Issue
Block a user