new asset: watercooler
This commit is contained in:
parent
fff7dfbbce
commit
1a058d5c2f
7 changed files with 33 additions and 11 deletions
BIN
assets/misc/watercooler.kra
Normal file
BIN
assets/misc/watercooler.kra
Normal file
Binary file not shown.
BIN
assets/misc/watercooler.png
Normal file
BIN
assets/misc/watercooler.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 475 B |
29
src/Load.hs
29
src/Load.hs
|
@ -59,7 +59,7 @@ loadFork
|
||||||
-> MVar (Float, T.Text)
|
-> MVar (Float, T.Text)
|
||||||
-> IO ()
|
-> IO ()
|
||||||
loadFork ws win glc nvg future progress = do
|
loadFork ws win glc nvg future progress = do
|
||||||
let stateSteps = 34
|
let stateSteps = 35
|
||||||
increment = 1 / stateSteps
|
increment = 1 / stateSteps
|
||||||
SDL.glMakeCurrent win glc
|
SDL.glMakeCurrent win glc
|
||||||
modifyMVar_ progress (return . (\(p, _) ->
|
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
|
mmiscPlant2 <- createImage nvg (FileName "assets/misc/plant2.png") 0
|
||||||
modifyMVar_ progress (return . (\(p, _) ->
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
( p + increment
|
( p + increment
|
||||||
, "Loading Animation \"intruder: standing\""
|
, "Loading asset \"watercooler\""
|
||||||
)))
|
)))
|
||||||
let mimgs = [ mwallasc, mwalldesc,
|
mmiscWatercooler <- createImage nvg (FileName "assets/misc/watercooler.png") 0
|
||||||
mwallcornern, mwallcornere, mwallcorners, mwallcornerw,
|
let mimgs =
|
||||||
mwalltne, mwalltse, mwalltsw, mwalltnw, mwallcross,
|
[ mwallasc, mwalldesc
|
||||||
mmiscbox1,
|
, mwallcornern, mwallcornere, mwallcorners, mwallcornerw
|
||||||
mtable1, mtable2, mtable3, mtable4, mtableC,
|
, mwalltne, mwalltse, mwalltsw, mwalltnw, mwallcross
|
||||||
mtablec1, mtablec2, mtablec3, mtablec4,
|
, mmiscbox1
|
||||||
mmiscFlipchart,
|
, mtable1, mtable2, mtable3, mtable4, mtableC
|
||||||
mmiscPlant1, mmiscPlant2
|
, mtablec1, mtablec2, mtablec3, mtablec4
|
||||||
|
, mmiscFlipchart
|
||||||
|
, mmiscPlant1, mmiscPlant2
|
||||||
|
, mmiscWatercooler
|
||||||
]
|
]
|
||||||
when (any isNothing mimgs) $ do
|
when (any isNothing mimgs) $ do
|
||||||
liftIO $logIO Error "Failed to load image assets"
|
liftIO $logIO Error "Failed to load image assets"
|
||||||
exitFailure
|
exitFailure
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading Animation \"intruder: standing\""
|
||||||
|
)))
|
||||||
-- playerImgs <- loadPlayerSprite "assets/intruder.png" 64 74 nvg
|
-- playerImgs <- loadPlayerSprite "assets/intruder.png" 64 74 nvg
|
||||||
-- (zipWith (\a b -> (a, [b])) [0..] $ [ImgIntrE .. ImgIntrN] ++ [ImgIntrNE])
|
-- (zipWith (\a b -> (a, [b])) [0..] $ [ImgIntrE .. ImgIntrN] ++ [ImgIntrNE])
|
||||||
let imgs = zipWith (\a b -> (a, fromJust b))
|
let imgs = zipWith (\a b -> (a, fromJust b))
|
||||||
[ ImgWallAsc
|
[ ImgWallAsc
|
||||||
.. ImgMiscPlant2
|
.. ImgMiscWatercooler
|
||||||
]
|
]
|
||||||
mimgs
|
mimgs
|
||||||
directions = [E .. N] ++ [NE]
|
directions = [E .. N] ++ [NE]
|
||||||
|
|
|
@ -97,6 +97,9 @@ instance Collidible ImgId where
|
||||||
collisionObstacle ImgMiscPlant2 =
|
collisionObstacle ImgMiscPlant2 =
|
||||||
[ Boundaries (9/36, 9/36) (27/36, 27/26)
|
[ Boundaries (9/36, 9/36) (27/36, 27/26)
|
||||||
]
|
]
|
||||||
|
collisionObstacle ImgMiscWatercooler =
|
||||||
|
[ Boundaries (14/36, 14/36) (22/36, 22/36)
|
||||||
|
]
|
||||||
collisionObstacle ImgEmptyNoWalk =
|
collisionObstacle ImgEmptyNoWalk =
|
||||||
[ Boundaries (0, 0) (1, 1) ]
|
[ Boundaries (0, 0) (1, 1) ]
|
||||||
collisionObstacle _ = []
|
collisionObstacle _ = []
|
||||||
|
|
|
@ -29,6 +29,7 @@ data ImgId
|
||||||
| ImgMiscFlipchart
|
| ImgMiscFlipchart
|
||||||
| ImgMiscPlant1
|
| ImgMiscPlant1
|
||||||
| ImgMiscPlant2
|
| ImgMiscPlant2
|
||||||
|
| ImgMiscWatercooler
|
||||||
-- | ImgIntrNE
|
-- | ImgIntrNE
|
||||||
-- | ImgIntrE
|
-- | ImgIntrE
|
||||||
-- | ImgIntrSE
|
-- | ImgIntrSE
|
||||||
|
|
|
@ -26,6 +26,7 @@ data Cluster
|
||||||
| ClusterPlant1
|
| ClusterPlant1
|
||||||
| ClusterPlant2
|
| ClusterPlant2
|
||||||
| ClusterToilet
|
| ClusterToilet
|
||||||
|
| ClusterWatercooler
|
||||||
deriving (Enum, Bounded)
|
deriving (Enum, Bounded)
|
||||||
|
|
||||||
clusterMat :: Cluster -> Matrix (Maybe ImgId)
|
clusterMat :: Cluster -> Matrix (Maybe ImgId)
|
||||||
|
@ -132,6 +133,11 @@ clusterMat ClusterPlant2 =
|
||||||
clusterMat ClusterToilet =
|
clusterMat ClusterToilet =
|
||||||
M.fromLists
|
M.fromLists
|
||||||
[ [ Just ImgEmpty, Just ImgEmptyNoWalk] ]
|
[ [ Just ImgEmpty, Just ImgEmptyNoWalk] ]
|
||||||
|
clusterMat ClusterWatercooler =
|
||||||
|
M.fromLists
|
||||||
|
[ [ Just ImgMiscWatercooler ]
|
||||||
|
, [ Just ImgEmpty ]
|
||||||
|
]
|
||||||
|
|
||||||
clusterRoom :: Cluster -> [TileState]
|
clusterRoom :: Cluster -> [TileState]
|
||||||
clusterRoom ClusterBox1 = [Offi]
|
clusterRoom ClusterBox1 = [Offi]
|
||||||
|
@ -148,6 +154,7 @@ clusterRoom ClusterConferenceTable2 = [Offi]
|
||||||
clusterRoom ClusterPlant1 = [Offi]
|
clusterRoom ClusterPlant1 = [Offi]
|
||||||
clusterRoom ClusterPlant2 = [Offi]
|
clusterRoom ClusterPlant2 = [Offi]
|
||||||
clusterRoom ClusterToilet = [Toil]
|
clusterRoom ClusterToilet = [Toil]
|
||||||
|
clusterRoom ClusterWatercooler = [Kitc, Offi]
|
||||||
|
|
||||||
clusterPoints :: Cluster -> [ReachPoint]
|
clusterPoints :: Cluster -> [ReachPoint]
|
||||||
clusterPoints ClusterBox1 = []
|
clusterPoints ClusterBox1 = []
|
||||||
|
@ -198,6 +205,9 @@ clusterPoints ClusterConferenceTable2 =
|
||||||
clusterPoints ClusterToilet =
|
clusterPoints ClusterToilet =
|
||||||
[ ReachPoint Toilet (V2 1 1) NE
|
[ ReachPoint Toilet (V2 1 1) NE
|
||||||
]
|
]
|
||||||
|
clusterPoints ClusterWatercooler =
|
||||||
|
[ ReachPoint Drink (V2 2 1) NW
|
||||||
|
]
|
||||||
clusterPoints _ = []
|
clusterPoints _ = []
|
||||||
|
|
||||||
instance Size Cluster where
|
instance Size Cluster where
|
||||||
|
|
|
@ -16,4 +16,5 @@ data PointType
|
||||||
| Copier
|
| Copier
|
||||||
| Computer
|
| Computer
|
||||||
| Toilet
|
| Toilet
|
||||||
|
| Drink
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
Loading…
Reference in a new issue