new: coffee machine and cabinet
This commit is contained in:
parent
33ff018294
commit
da3b7a2b76
8 changed files with 26 additions and 2 deletions
BIN
assets/cabinet/cabCoffeeSW.kra
Normal file
BIN
assets/cabinet/cabCoffeeSW.kra
Normal file
Binary file not shown.
BIN
assets/cabinet/cabCoffeeSW.png
Normal file
BIN
assets/cabinet/cabCoffeeSW.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 824 B |
BIN
assets/cabinet/cabinetSW.kra
Normal file
BIN
assets/cabinet/cabinetSW.kra
Normal file
Binary file not shown.
BIN
assets/cabinet/cabinetSW.png
Normal file
BIN
assets/cabinet/cabinetSW.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 446 B |
15
src/Load.hs
15
src/Load.hs
|
@ -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))
|
||||
|
|
|
@ -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 _ = []
|
||||
|
|
|
@ -35,6 +35,8 @@ data ImgId
|
|||
| ImgMiscPlant2
|
||||
| ImgMiscWatercooler
|
||||
| ImgMiscVending
|
||||
| ImgCabinetCoffee
|
||||
| ImgCabinetSW
|
||||
-- | ImgIntrNE
|
||||
-- | ImgIntrE
|
||||
-- | ImgIntrSE
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue