new asset: watercooler

This commit is contained in:
nek0 2018-08-07 14:04:49 +02:00
parent fff7dfbbce
commit 1a058d5c2f
7 changed files with 33 additions and 11 deletions

BIN
assets/misc/watercooler.kra Normal file

Binary file not shown.

BIN
assets/misc/watercooler.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

View file

@ -59,7 +59,7 @@ loadFork
-> MVar (Float, T.Text)
-> IO ()
loadFork ws win glc nvg future progress = do
let stateSteps = 34
let stateSteps = 35
increment = 1 / stateSteps
SDL.glMakeCurrent win glc
modifyMVar_ progress (return . (\(p, _) ->
@ -184,25 +184,32 @@ loadFork ws win glc nvg future progress = do
mmiscPlant2 <- createImage nvg (FileName "assets/misc/plant2.png") 0
modifyMVar_ progress (return . (\(p, _) ->
( p + increment
, "Loading Animation \"intruder: standing\""
, "Loading asset \"watercooler\""
)))
let mimgs = [ mwallasc, mwalldesc,
mwallcornern, mwallcornere, mwallcorners, mwallcornerw,
mwalltne, mwalltse, mwalltsw, mwalltnw, mwallcross,
mmiscbox1,
mtable1, mtable2, mtable3, mtable4, mtableC,
mtablec1, mtablec2, mtablec3, mtablec4,
mmiscFlipchart,
mmiscPlant1, mmiscPlant2
mmiscWatercooler <- createImage nvg (FileName "assets/misc/watercooler.png") 0
let mimgs =
[ mwallasc, mwalldesc
, mwallcornern, mwallcornere, mwallcorners, mwallcornerw
, mwalltne, mwalltse, mwalltsw, mwalltnw, mwallcross
, mmiscbox1
, mtable1, mtable2, mtable3, mtable4, mtableC
, mtablec1, mtablec2, mtablec3, mtablec4
, mmiscFlipchart
, mmiscPlant1, mmiscPlant2
, mmiscWatercooler
]
when (any isNothing mimgs) $ do
liftIO $logIO Error "Failed to load image assets"
exitFailure
modifyMVar_ progress (return . (\(p, _) ->
( p + increment
, "Loading Animation \"intruder: standing\""
)))
-- playerImgs <- loadPlayerSprite "assets/intruder.png" 64 74 nvg
-- (zipWith (\a b -> (a, [b])) [0..] $ [ImgIntrE .. ImgIntrN] ++ [ImgIntrNE])
let imgs = zipWith (\a b -> (a, fromJust b))
[ ImgWallAsc
.. ImgMiscPlant2
.. ImgMiscWatercooler
]
mimgs
directions = [E .. N] ++ [NE]

View file

@ -97,6 +97,9 @@ instance Collidible ImgId where
collisionObstacle ImgMiscPlant2 =
[ Boundaries (9/36, 9/36) (27/36, 27/26)
]
collisionObstacle ImgMiscWatercooler =
[ Boundaries (14/36, 14/36) (22/36, 22/36)
]
collisionObstacle ImgEmptyNoWalk =
[ Boundaries (0, 0) (1, 1) ]
collisionObstacle _ = []

View file

@ -29,6 +29,7 @@ data ImgId
| ImgMiscFlipchart
| ImgMiscPlant1
| ImgMiscPlant2
| ImgMiscWatercooler
-- | ImgIntrNE
-- | ImgIntrE
-- | ImgIntrSE

View file

@ -26,6 +26,7 @@ data Cluster
| ClusterPlant1
| ClusterPlant2
| ClusterToilet
| ClusterWatercooler
deriving (Enum, Bounded)
clusterMat :: Cluster -> Matrix (Maybe ImgId)
@ -132,6 +133,11 @@ clusterMat ClusterPlant2 =
clusterMat ClusterToilet =
M.fromLists
[ [ Just ImgEmpty, Just ImgEmptyNoWalk] ]
clusterMat ClusterWatercooler =
M.fromLists
[ [ Just ImgMiscWatercooler ]
, [ Just ImgEmpty ]
]
clusterRoom :: Cluster -> [TileState]
clusterRoom ClusterBox1 = [Offi]
@ -148,6 +154,7 @@ clusterRoom ClusterConferenceTable2 = [Offi]
clusterRoom ClusterPlant1 = [Offi]
clusterRoom ClusterPlant2 = [Offi]
clusterRoom ClusterToilet = [Toil]
clusterRoom ClusterWatercooler = [Kitc, Offi]
clusterPoints :: Cluster -> [ReachPoint]
clusterPoints ClusterBox1 = []
@ -198,6 +205,9 @@ clusterPoints ClusterConferenceTable2 =
clusterPoints ClusterToilet =
[ ReachPoint Toilet (V2 1 1) NE
]
clusterPoints ClusterWatercooler =
[ ReachPoint Drink (V2 2 1) NW
]
clusterPoints _ = []
instance Size Cluster where

View file

@ -16,4 +16,5 @@ data PointType
| Copier
| Computer
| Toilet
| Drink
deriving (Eq, Show)