Simplify cloud/dust update
This commit is contained in:
+3
-2
@@ -18,13 +18,14 @@ import RandomHelp
|
||||
|
||||
updateFlame :: World -> Flame -> (World, Maybe Flame)
|
||||
updateFlame w pt
|
||||
| _flTimer pt <= 0 = (makeCloudAt Smoke 200 (addZ 20 ep) w, Nothing)
|
||||
| _flTimer pt <= 0 = (mcloud w, Nothing)
|
||||
| Just (_, Right wl) <- thit = (doupdate, Just $ reflame wl)
|
||||
-- might want to move differently if we hit a creature?
|
||||
| _flTimer pt <= 1 = (makeCloudAt Smoke 200 (addZ 20 ep) $ flFlicker pt doupdate
|
||||
| _flTimer pt <= 1 = (mcloud $ flFlicker pt doupdate
|
||||
, Just mvflame)
|
||||
| otherwise = (flFlicker pt doupdate, Just mvflame)
|
||||
where
|
||||
mcloud = makeCloudAt Smoke 200 (addZ 20 ep)
|
||||
reflame wl = pt & flTimer -~ 1 & flVel %~ reflVelWallDamp 0.9 wl
|
||||
doupdate =
|
||||
soundContinue FlameSound sp fireLoudS (Just 2) $
|
||||
|
||||
Reference in New Issue
Block a user