Refactor, try to limit dependencies
This commit is contained in:
+9
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user