Identify broken wall collisions
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
{- Bullet update. -}
|
||||
module Dodge.Particle.Bullet.Update
|
||||
( mvGenBullet
|
||||
( mvBullet
|
||||
) where
|
||||
import Dodge.Data
|
||||
--import Dodge.Base
|
||||
import Dodge.WorldEvent.ThingsHit
|
||||
--import Picture
|
||||
import Geometry
|
||||
--import Geometry.Vector3D
|
||||
|
||||
import Control.Lens
|
||||
{-
|
||||
Update for a generic bullet.
|
||||
-}
|
||||
mvGenBullet :: World -> Particle -> (World, Maybe Particle)
|
||||
mvGenBullet w bt
|
||||
| t <= 0 = (w, Nothing)
|
||||
| t < 4 = (w, Just $ bt
|
||||
& btPassThrough' .~ Nothing
|
||||
& btTrail' .~ (p:p:ps)
|
||||
& btTimer' -~ 1
|
||||
)
|
||||
mvBullet :: World -> Particle -> (World, Maybe Particle)
|
||||
mvBullet w bt
|
||||
| t <= 0 = wAnd Nothing
|
||||
| t < 4 = wAnd $ Just $ bt
|
||||
& btPassThrough' .~ Nothing
|
||||
& btTrail' .~ (p:p:ps)
|
||||
& btTimer' -~ 1
|
||||
-- | otherwise = hiteff bt (thingsHitExceptCr3D' mcr (addZ 20 p) (addZ 20 (p +.+ vel)) w) w
|
||||
| otherwise = hiteff bt (thingsHitExceptCr mcr p (p +.+ vel) w) w
|
||||
where
|
||||
wAnd = (w,)
|
||||
mcr = _btPassThrough' bt
|
||||
(p:ps) = _btTrail' bt
|
||||
vel = _btVel' bt
|
||||
|
||||
Reference in New Issue
Block a user