more entomology

This commit is contained in:
nek0 2018-05-13 22:01:05 +02:00
parent c14c652360
commit 165baa179c
2 changed files with 5 additions and 8 deletions

View file

@ -141,7 +141,7 @@ updateNPCs imgmat rp dt =
}
else
return $ defEntity'
{ vel = Set $ (* 0.5) <$> signorm (itarget - pos')
{ vel = Set $ (* 2) <$> signorm (itarget - pos')
}
else do
ttl <- liftIO $ randomRIO (5, 30)

View file

@ -95,7 +95,7 @@ mouseToPlayer mv2 = do
emap $ do
with player
pure $ defEntity'
{ vel = Set $ V2 dr dc
{ vel = Set $ 4 * V2 dr dc
}
putAffection ud
{ worldState = nws
@ -184,7 +184,7 @@ updateMap dt = do
with pos
pos'@(V2 pr pc) <- E.get pos
vel' <- E.get vel
let npos@(V2 nr nc) = pos' + fmap (* (4 * dt)) vel'
let npos@(V2 nr nc) = pos' + fmap (* dt) vel'
dpos = npos - pos'
ent = defEntity'
{ pos = Set $ npos
@ -196,7 +196,7 @@ updateMap dt = do
with pos
pos'@(V2 pr pc) <- E.get pos
vel' <- E.get vel
let npos@(V2 nr nc) = pos' + fmap (* (4 * dt)) vel'
let npos@(V2 nr nc) = pos' + fmap (* dt) vel'
dpos@(V2 dpr dpc) = npos - pos'
len = sqrt (dpos `dot` dpos)
lll = (,)
@ -240,7 +240,7 @@ updateMap dt = do
(maxr + fromIntegral dr, maxc + fromIntegral dc)
) bs
)
lll
(A.log A.Debug (show lll ++ " " ++ show len) lll)
)
}
return ent
@ -373,11 +373,8 @@ checkBoundsCollision2
-> V2 Double
checkBoundsCollision2
pre@(V2 pr pc) next@(V2 nr nc) dt acc (Boundaries (minr, minc) (maxr, maxc))
-- | colltr < 0 && colltc < 0 = A.log A.Debug (show (colltr, colltc)) (V2 (colltr / dt) (colltc / dt))
| (colltr < 0 && colltc < 0) || (inrow && incol) = A.log A.Debug ("both " ++ show (colltr, colltc)) (V2 0 0)
-- | colltr < 0 && colltc >= dt = (V2 (colltr / dt) 1)
| colltr < 0 && incol = (A.log A.Debug ("row fixed " ++ show (colltr, colltc))(V2 0 1)) * acc
-- | colltc < 0 && colltc >= dt = (V2 1 (colltr / dt))
| colltc < 0 && inrow = (A.log A.Debug ("col fixed " ++ show (colltr, colltc))(V2 1 0)) * acc
| otherwise = acc
where