Allow for door destruction

This commit is contained in:
2022-06-19 20:50:03 +01:00
parent 9e311cccf4
commit 08e5df07e2
14 changed files with 82 additions and 42 deletions
+5 -15
View File
@@ -75,26 +75,16 @@ dirtColor :: Color
dirtColor = V4 (150/256) ( 75/256) 0 ( 250/256)
glassDebris :: Prop
glassDebris = PropZ
{_prPos = 0
,_pjStartPos = 0
,_pjVel = 0
,_prDraw = \pr -> drawMovingShape pr (shardShape 4 pr)
,_pjID = 0
,_pjUpdate = fallSmallBounce
,_pjPosZ = 10
,_pjVelZ = 5
,_pjTimer = 20
,_pjQuat = Q.axisAngle (V3 1 0 0) 0
,_pjQuatSpin = Q.axisAngle (V3 1 1 0) 0.1
,_pjColor = withAlpha 0.5 cyan
}
glassDebris = stoneDebris
& prDraw .~ (\pr -> drawMovingShape pr (shardShape 4 pr))
& pjUpdate .~ fallSmallBounce
& pjColor .~ withAlpha 0.5 cyan
crystalDebris :: Prop
crystalDebris = glassDebris
& pjColor .~ withAlpha 0.5 aquamarine
shardShape :: Float -> Prop -> Shape
shardShape size pr = colorSH (_pjColor pr) . translateSHz (-size) $ upperPrismPoly size $
shardShape size pr = colorSH (_pjColor pr) . translateSHz (-size) $ upperPrismPoly size
[V2 size 0
,V2 (-size) 1
,V2 (-size) (-1)