new: coffee machine and cabinet

This commit is contained in:
nek0 2019-01-14 04:00:34 +01:00
parent 33ff018294
commit da3b7a2b76
8 changed files with 26 additions and 2 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

View file

@ -63,7 +63,7 @@ loadFork
-> MVar (Float, T.Text)
-> IO ()
loadFork ws win glc nvg future progress = do
let stateSteps = 41
let stateSteps = 43
increment = 1 / stateSteps
SDL.glMakeCurrent win glc
modifyMVar_ progress (return . (\(p, _) ->
@ -211,6 +211,16 @@ loadFork ws win glc nvg future progress = do
, "Loading asset \"vending machine\""
)))
mmiscVending <- createImage nvg (FileName "assets/misc/vending.png") 0
modifyMVar_ progress (return . (\(p, _) ->
( p + increment
, "Loading asset \"Cabinet with Coffee machine\""
)))
mmiscCabCoffee <- createImage nvg (FileName "assets/cabinet/cabCoffeeSW.png") 0
modifyMVar_ progress (return . (\(p, _) ->
( p + increment
, "Loading asset \"cabinet SW\""
)))
mmiscCabinetSW <- createImage nvg (FileName "assets/cabinet/cabinetSW.png") 0
let micons =
[ mcontrblue, mcontrgreen, marrow
]
@ -227,6 +237,7 @@ loadFork ws win glc nvg future progress = do
, mmiscFlipchart
, mmiscPlant1, mmiscPlant2
, mmiscWatercooler, mmiscVending
, mmiscCabCoffee, mmiscCabinetSW
]
when (any isNothing mimgs) $ do
liftIO $logIO Error "Failed to load image assets"
@ -239,7 +250,7 @@ loadFork ws win glc nvg future progress = do
-- (zipWith (\a b -> (a, [b])) [0..] $ [ImgIntrE .. ImgIntrN] ++ [ImgIntrNE])
let imgs = zipWith (\a b -> (a, fromJust b))
[ ImgWallAsc
.. ImgMiscVending
.. ImgCabinetSW
]
mimgs
icons = zipWith (\a b -> (a, fromJust b))

View file

@ -99,6 +99,8 @@ instance Collidible ImgId where
collisionObstacle ImgMiscVending =
[ Boundaries (0, 2/36) (24/36, 34/36)
]
collisionObstacle ImgCabinetCoffee = collisionObstacle ImgTableSW
collisionObstacle ImgCabinetSW = collisionObstacle ImgTableSW
collisionObstacle ImgEmptyNoWalk =
[ Boundaries (0, 0) (0.99, 0.99) ]
collisionObstacle _ = []

View file

@ -35,6 +35,8 @@ data ImgId
| ImgMiscPlant2
| ImgMiscWatercooler
| ImgMiscVending
| ImgCabinetCoffee
| ImgCabinetSW
-- | ImgIntrNE
-- | ImgIntrE
-- | ImgIntrSE

View file

@ -28,6 +28,7 @@ data Cluster
| ClusterToilet
| ClusterWatercooler
| ClusterVending
| ClusterCabCoffee
deriving (Enum, Bounded, Show)
-- row -> NS; col -> WE
@ -118,6 +119,10 @@ clusterMat ClusterVending _ =
[ [ Just ImgMiscVending ]
, [ Just ImgEmpty ]
]
clusterMat ClusterCabCoffee _ =
M.fromLists
[ [ Just ImgEmpty, Just ImgCabinetCoffee ]
]
clusterRoom :: Cluster -> [TileState]
clusterRoom ClusterBox1 = [Offi]
@ -135,6 +140,7 @@ clusterRoom ClusterPlant2 = [Offi]
clusterRoom ClusterToilet = [Toil]
clusterRoom ClusterWatercooler = [Kitc, Offi]
clusterRoom ClusterVending = [Kitc]
clusterRoom ClusterCabCoffee = [Kitc]
clusterPoints :: Cluster -> (Int, Int) -> [ReachPoint]
clusterPoints ClusterBox1 _ = []
@ -177,6 +183,9 @@ clusterPoints ClusterWatercooler _ =
clusterPoints ClusterVending _ =
[ ReachPoint Eat (V2 2 1) NW
]
clusterPoints ClusterCabCoffee _ =
[ ReachPoint Drink (V2 1 1) NE
]
clusterPoints _ _ = []
instance Size (Cluster, (Int, Int)) where