Refactor projectiles

This commit is contained in:
2022-07-20 09:55:07 +01:00
parent 9daf872878
commit 330a81a955
14 changed files with 196 additions and 200 deletions
+8 -8
View File
@@ -5,13 +5,13 @@ import Dodge.Data
import Geometry.Vector
import Control.Lens
decTimMvVel :: Prop -> World -> World
decTimMvVel pj = props . ix pjid %~
( (pjTimer -~ 1)
. (prPos %~ (+.+ vel) )
. (pjAcc %~ rotateV rot )
decTimMvVel :: Proj -> World -> World
decTimMvVel pj = projectiles . ix pjid %~
( (prjTimer -~ 1)
. (prjPos %~ (+.+ vel) )
. (prjAcc %~ rotateV rot )
)
where
rot = _pjSpin pj
vel = _pjVel pj
pjid = _pjID pj
rot = _prjSpin pj
vel = _prjVel pj
pjid = _prjID pj