Refactor, try to limit dependencies

This commit is contained in:
2022-07-28 00:59:56 +01:00
parent 8aa5c17ab9
commit 160560af5f
418 changed files with 15104 additions and 13342 deletions
+9 -6
View File
@@ -1,8 +1,9 @@
module Dodge.Gas where
import Dodge.Data
import Geometry
import Dodge.Data.World
import Dodge.Flame
import Dodge.WorldEvent
import Geometry
createGas :: GasCreate -> Float -> Point2 -> Float -> Creature -> World -> World
createGas gc = case gc of
@@ -10,12 +11,14 @@ createGas gc = case gc of
CreateFlame -> aFlame
aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World
aGasCloud pressure pos dir cr = makeGasCloud pos
$ (_crPos cr -.- _crOldPos cr) +.+ pressure *.* unitVectorAtAngle dir
aGasCloud pressure pos dir cr =
makeGasCloud pos $
(_crPos cr -.- _crOldPos cr) +.+ pressure *.* unitVectorAtAngle dir
aFlame :: Float -> Point2 -> Float -> Creature -> World -> World
aFlame pressure pos dir cr = makeFlame pos vel
where
--w & instantParticles .:~ aFlameParticle t pos vel Nothing -- (Just $ _crID cr)
where
-- (t,_) = randomR (99,101) (_randGen w)
-- (t,_) = randomR (99,101) (_randGen w)
vel = (_crPos cr -.- _crOldPos cr) +.+ pressure *.* unitVectorAtAngle dir