Improve bee pheremones

This commit is contained in:
2026-04-26 09:14:55 +01:00
parent 264651d34a
commit f4c59612ea
5 changed files with 41 additions and 20 deletions
+4 -8
View File
@@ -316,8 +316,8 @@ functionalUpdate =
(updateIMl' (_linearShockwaves . _lWorld . _cWorld) updateLinearShockwave)
. over uvWorld (updateIMl' (_projectiles . _lWorld . _cWorld) updateProjectile)
. over uvWorld updateClouds
. over uvWorld updateBeePheremones
. over uvWorld updateGasses
. over uvWorld (updateObjMapMaybe beePheremones updateBeePheremone)
. over uvWorld (updateObjCatMaybes gasses updateGas)
. over uvWorld updateDusts
. over uvWorld updateGusts
. over uvWorld (updateIMl' (_terminals . _lWorld . _cWorld) updateTerminal)
@@ -780,17 +780,13 @@ updateSparks = updateObjCatMaybes sparks updateSpark
updateClouds :: World -> World
updateClouds w = updateObjMapMaybe clouds (updateCloud w) w
updateBeePheremones :: World -> World
updateBeePheremones w = updateObjMapMaybe beePheremones updateBeePheremone w
updateBeePheremone :: BeePheremone -> Maybe BeePheremone
updateBeePheremone bp
| x <- bp ^. bpTimer
, x <= 0 = Nothing
| otherwise = Just $ bp & bpTimer -~ 1
updateGasses :: World -> World
updateGasses = updateObjCatMaybes gasses updateGas
& bpVel *~ 0.95
& bpPos +~ (bp ^. bpVel)
updateDusts :: World -> World
updateDusts w = updateObjMapMaybe dusts (updateDust w) w