Fix console item creation, fix tank object clockwise orientation
This commit is contained in:
+6
-11
@@ -1,22 +1,17 @@
|
|||||||
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:3:1: warning: [-Wunused-imports]
|
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:19: warning: [-Wunused-matches]
|
||||||
The import of ‘TreeHelp’ is redundant
|
|
||||||
|
|
|
||||||
3 | import TreeHelp
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:46:19: warning: [-Wunused-matches]
|
|
||||||
Defined but not used: ‘cr’
|
Defined but not used: ‘cr’
|
||||||
|
|
|
|
||||||
46 | upDownAttachments cr i j s = s
|
45 | upDownAttachments cr i j s = s
|
||||||
| ^^
|
| ^^
|
||||||
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:46:22: warning: [-Wunused-matches]
|
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:22: warning: [-Wunused-matches]
|
||||||
Defined but not used: ‘i’
|
Defined but not used: ‘i’
|
||||||
|
|
|
|
||||||
46 | upDownAttachments cr i j s = s
|
45 | upDownAttachments cr i j s = s
|
||||||
| ^
|
| ^
|
||||||
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:46:24: warning: [-Wunused-matches]
|
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:24: warning: [-Wunused-matches]
|
||||||
Defined but not used: ‘j’
|
Defined but not used: ‘j’
|
||||||
|
|
|
|
||||||
46 | upDownAttachments cr i j s = s
|
45 | upDownAttachments cr i j s = s
|
||||||
| ^
|
| ^
|
||||||
/home/justin/Haskell/loop/src/Dodge/Item.hs:29:25: warning: [-Wincomplete-patterns]
|
/home/justin/Haskell/loop/src/Dodge/Item.hs:29:25: warning: [-Wincomplete-patterns]
|
||||||
Pattern match(es) are non-exhaustive
|
Pattern match(es) are non-exhaustive
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1,5 @@
|
|||||||
module Dodge.Base.You where
|
module Dodge.Base.You where
|
||||||
|
|
||||||
import TreeHelp
|
|
||||||
import Dodge.Data.World
|
import Dodge.Data.World
|
||||||
import Dodge.HeldScroll
|
import Dodge.HeldScroll
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ data Block = Block
|
|||||||
, _blWallIDs :: IS.IntSet
|
, _blWallIDs :: IS.IntSet
|
||||||
, _blHP :: Int
|
, _blHP :: Int
|
||||||
, _blShadows :: [Int] -- a list of blocks/walls? that are not shown when this block exists
|
, _blShadows :: [Int] -- a list of blocks/walls? that are not shown when this block exists
|
||||||
, _blFootprint :: [Point2]
|
, _blFootprint :: [Point2] -- TODO check whether this should be clockwise/anticlockwise
|
||||||
, _blPos :: Point2
|
, _blPos :: Point2
|
||||||
, _blDir :: Float
|
, _blDir :: Float
|
||||||
, _blHeight :: Float
|
, _blHeight :: Float
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ parseItem (x : xs) =
|
|||||||
<|> (readMaybe ("HELD {_ibtHeld=" ++ x ++ "}") <&> (,parseNum xs))
|
<|> (readMaybe ("HELD {_ibtHeld=" ++ x ++ "}") <&> (,parseNum xs))
|
||||||
<|> (readMaybe ("EQUIP {_ibtEquip=" ++ x ++ "}") <&> (,parseNum xs))
|
<|> (readMaybe ("EQUIP {_ibtEquip=" ++ x ++ "}") <&> (,parseNum xs))
|
||||||
<|> (readMaybe ("LEFT {_ibtLEFT=" ++ x ++ "}") <&> (,parseNum xs))
|
<|> (readMaybe ("LEFT {_ibtLEFT=" ++ x ++ "}") <&> (,parseNum xs))
|
||||||
<|> (readMaybe ("HELD (" ++ x ++ " {_xNum=" ++ show (parseNum xs) ++ "}") <&> (,1))
|
<|> (readMaybe ("HELD {_ibtHeld=(" ++ x ++ " {_xNum=" ++ show (parseNum xs) ++ "})}") <&> (,1))
|
||||||
<|> (readMaybe ("ATTACH (" ++ x ++ ")") <&> (,parseNum xs))
|
<|> (readMaybe ("ATTACH (" ++ x ++ ")") <&> (,parseNum xs))
|
||||||
<|> (readMaybe ("CONSUMABLE {_ibtConsumable=" ++ x ++ "}") <&> (,parseNum xs))
|
<|> (readMaybe ("CONSUMABLE {_ibtConsumable=" ++ x ++ "}") <&> (,parseNum xs))
|
||||||
<|> (readMaybe ("AMMO {_ibtAmmo=" ++ x ++ "}") <&> (,parseNum xs))
|
<|> (readMaybe ("AMMO {_ibtAmmo=" ++ x ++ "}") <&> (,parseNum xs))
|
||||||
|
|||||||
@@ -17,27 +17,11 @@ tankSquareDec ::
|
|||||||
Color ->
|
Color ->
|
||||||
Color ->
|
Color ->
|
||||||
Placement
|
Placement
|
||||||
tankSquareDec dec = tankShape (reverse $ square 20) (dec 20 20 31)
|
tankSquareDec dec = tankShape (reverse . orderPolygon $ square 20) (dec 20 20 31)
|
||||||
|
|
||||||
tankShape :: [Point2] -> (Color -> Color -> Shape) -> Color -> Color -> Placement
|
tankShape :: [Point2] -> (Color -> Color -> Shape) -> Color -> Color -> Placement
|
||||||
tankShape baseshape facade col col' = sps0 $ decoratedBlock (BlShConst $ facade col col') Metal col 31 baseshape
|
tankShape baseshape facade col col' = sps0 $ decoratedBlock (BlShConst $ facade col col') Metal col 31 baseshape
|
||||||
|
|
||||||
-- = sps0 $ PutBlock bl wl $ reverse baseshape
|
|
||||||
-- where
|
|
||||||
-- bl = defaultBlock
|
|
||||||
-- & blDraw .~ const (noPic $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col')
|
|
||||||
-- & blDeath .~ const id
|
|
||||||
-- wl = defaultWall
|
|
||||||
-- & wlColor .~ col
|
|
||||||
-- & wlRotateTo .~ False
|
|
||||||
-- & wlOpacity .~ SeeAbove
|
|
||||||
-- & wlMaterial .~ Metal
|
|
||||||
|
|
||||||
-- = ps0jPushPS
|
|
||||||
-- (PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
|
|
||||||
-- $ sps0 $ PutWall baseshape defaultWall
|
|
||||||
-- {_wlUnshadowed = False, _wlColor = col, _wlRotateTo = False, _wlOpacity = SeeAbove}
|
|
||||||
|
|
||||||
roundTank :: Color -> Color -> Placement
|
roundTank :: Color -> Color -> Placement
|
||||||
roundTank = tankShape (polyCirc 4 20) $
|
roundTank = tankShape (polyCirc 4 20) $
|
||||||
\_ c' -> colorSH c' $ foldMap toprail (take 8 [0, pi / 4 ..])
|
\_ c' -> colorSH c' $ foldMap toprail (take 8 [0, pi / 4 ..])
|
||||||
|
|||||||
Reference in New Issue
Block a user