Refactoring
This commit is contained in:
@@ -288,15 +288,15 @@ blinkAction
|
||||
:: Int -- ^ Creature id
|
||||
-> World
|
||||
-> World
|
||||
blinkAction n w = soundOnce teleSound
|
||||
$ set (creatures . ix n . crPos) p3
|
||||
$ blinkShockwave n p3
|
||||
$ inverseShockwaveAt cp 40 2 2 2
|
||||
w
|
||||
blinkAction n w
|
||||
= soundOnce teleSound
|
||||
. set (creatures . ix n . crPos) p3
|
||||
. blinkShockwave n p3
|
||||
$ inverseShockwaveAt cp 40 2 2 2 w
|
||||
where
|
||||
p1 = _cameraCenter w +.+ (1 / _cameraZoom w) *.* rotateV (_cameraRot w) (_mousePos w)
|
||||
cp = _crPos $ _creatures w IM.! n
|
||||
p2 = collidePointWalls cp p1 $ wallsAlongLine cp p1 w
|
||||
p2 = reflectPointWalls cp p1 $ wallsAlongLine cp p1 w
|
||||
r = 1.5 * _crRad (_creatures w IM.! n)
|
||||
p3 = fromMaybe p1 (fmap ((\p -> moveAmountToward p r cp) . fst) p2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user