prepare more cabinets
This commit is contained in:
parent
dfd17eb973
commit
43e7a30ddc
14 changed files with 66 additions and 13 deletions
BIN
assets/cabinet/cabCoffeeSE.kra
Normal file
BIN
assets/cabinet/cabCoffeeSE.kra
Normal file
Binary file not shown.
BIN
assets/cabinet/cabCoffeeSE.png
Normal file
BIN
assets/cabinet/cabCoffeeSE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 815 B |
BIN
assets/cabinet/cabSinkSE.kra
Normal file
BIN
assets/cabinet/cabSinkSE.kra
Normal file
Binary file not shown.
BIN
assets/cabinet/cabSinkSE.png
Normal file
BIN
assets/cabinet/cabSinkSE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 614 B |
BIN
assets/cabinet/cabSinkSW.kra
Normal file
BIN
assets/cabinet/cabSinkSW.kra
Normal file
Binary file not shown.
BIN
assets/cabinet/cabSinkSW.png
Normal file
BIN
assets/cabinet/cabSinkSW.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 622 B |
BIN
assets/cabinet/cabStoveSE.kra
Normal file
BIN
assets/cabinet/cabStoveSE.kra
Normal file
Binary file not shown.
BIN
assets/cabinet/cabStoveSE.png
Normal file
BIN
assets/cabinet/cabStoveSE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 595 B |
BIN
assets/cabinet/cabStoveSW.kra
Normal file
BIN
assets/cabinet/cabStoveSW.kra
Normal file
Binary file not shown.
BIN
assets/cabinet/cabStoveSW.png
Normal file
BIN
assets/cabinet/cabStoveSW.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 616 B |
|
@ -81,6 +81,7 @@ placeCluster
|
||||||
placeCluster imat rng bnds dim try mat rp appl =
|
placeCluster imat rng bnds dim try mat rp appl =
|
||||||
let (pr, g1) = randomR (fst (matmin bnds) - 1, fst (matmax bnds) - 1) rng
|
let (pr, g1) = randomR (fst (matmin bnds) - 1, fst (matmax bnds) - 1) rng
|
||||||
(pc, g2) = randomR (snd (matmin bnds) - 1, snd (matmax bnds) - 1) g1
|
(pc, g2) = randomR (snd (matmin bnds) - 1, snd (matmax bnds) - 1) g1
|
||||||
|
(g2_1, g2_2) = split g2
|
||||||
freeRoom = foldl
|
freeRoom = foldl
|
||||||
(\acc a -> if isNothing a then acc + 1 else acc)
|
(\acc a -> if isNothing a then acc + 1 else acc)
|
||||||
0
|
0
|
||||||
|
@ -89,7 +90,7 @@ placeCluster imat rng bnds dim try mat rp appl =
|
||||||
(snd $ matmin bnds) (snd $ matmax bnds)
|
(snd $ matmin bnds) (snd $ matmax bnds)
|
||||||
mat
|
mat
|
||||||
) :: Int
|
) :: Int
|
||||||
cmat = clusterMat appl dim
|
cmat = clusterMat appl dim g2_2
|
||||||
newmat = insertMat cmat mat (pr, pc)
|
newmat = insertMat cmat mat (pr, pc)
|
||||||
exits = filter
|
exits = filter
|
||||||
(\p -> pointType p == RoomExit && inBounds (pointCoord p) bnds)
|
(\p -> pointType p == RoomExit && inBounds (pointCoord p) bnds)
|
||||||
|
@ -129,7 +130,7 @@ placeCluster imat rng bnds dim try mat rp appl =
|
||||||
mat
|
mat
|
||||||
))
|
))
|
||||||
then A.log A.Debug ("no cluster placed") $
|
then A.log A.Debug ("no cluster placed") $
|
||||||
placeCluster imat g2 bnds dim (try + 1) mat rp appl
|
placeCluster imat g2_1 bnds dim (try + 1) mat rp appl
|
||||||
else if
|
else if
|
||||||
any (`elem` (oldreaches))
|
any (`elem` (oldreaches))
|
||||||
(V2
|
(V2
|
||||||
|
@ -140,9 +141,9 @@ placeCluster imat rng bnds dim try mat rp appl =
|
||||||
else if
|
else if
|
||||||
isReachable newmat [(V2 10 10, Boundaries (0, 1) (0, 1))] (oldreaches ++ reaches) exits
|
isReachable newmat [(V2 10 10, Boundaries (0, 1) (0, 1))] (oldreaches ++ reaches) exits
|
||||||
then A.log A.Debug ("placed cluster" ++ show appl) $
|
then A.log A.Debug ("placed cluster" ++ show appl) $
|
||||||
placeCluster imat g2 bnds dim (try + 1) newmat newrp appl
|
placeCluster imat g2_1 bnds dim (try + 1) newmat newrp appl
|
||||||
else A.log A.Debug ("no cluster placed") $
|
else A.log A.Debug ("no cluster placed") $
|
||||||
placeCluster imat g2 bnds dim (try + 1) mat rp appl
|
placeCluster imat g2_1 bnds dim (try + 1) mat rp appl
|
||||||
|
|
||||||
insertMat
|
insertMat
|
||||||
:: Matrix (Maybe a)
|
:: Matrix (Maybe a)
|
||||||
|
|
50
src/Load.hs
50
src/Load.hs
|
@ -63,7 +63,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 = 43
|
let stateSteps = 49
|
||||||
increment = 1 / stateSteps
|
increment = 1 / stateSteps
|
||||||
SDL.glMakeCurrent win glc
|
SDL.glMakeCurrent win glc
|
||||||
modifyMVar_ progress (return . (\(p, _) ->
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
@ -213,14 +213,49 @@ loadFork ws win glc nvg future progress = do
|
||||||
mmiscVending <- createImage nvg (FileName "assets/misc/vending.png") 0
|
mmiscVending <- createImage nvg (FileName "assets/misc/vending.png") 0
|
||||||
modifyMVar_ progress (return . (\(p, _) ->
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
( p + increment
|
( p + increment
|
||||||
, "Loading asset \"Cabinet with Coffee machine\""
|
, "Loading asset \"Cabinet with Coffee machine SW\""
|
||||||
)))
|
)))
|
||||||
mmiscCabCoffee <- createImage nvg (FileName "assets/cabinet/cabCoffeeSW.png") 0
|
mcabCoffeeSW <- createImage nvg (FileName "assets/cabinet/cabCoffeeSW.png") 0
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading asset \"Cabinet with Coffee machine SE\""
|
||||||
|
)))
|
||||||
|
mcabCoffeeSE <- createImage nvg (FileName "assets/cabinet/cabCoffeeSE.png") 0
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading asset \"Cabinet with sink SW\""
|
||||||
|
)))
|
||||||
|
mcabSinkSW <- createImage nvg (FileName "assets/cabinet/cabSinkSW.png") 0
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading asset \"Cabinet with sink SE\""
|
||||||
|
)))
|
||||||
|
mcabSinkSE <- createImage nvg (FileName "assets/cabinet/cabSinkSE.png") 0
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading asset \"Cabinet with stove SW\""
|
||||||
|
)))
|
||||||
|
mcabStoveSW <- createImage nvg (FileName "assets/cabinet/cabStoveSW.png") 0
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading asset \"Cabinet with stove SE\""
|
||||||
|
)))
|
||||||
|
mcabStoveSE <- createImage nvg (FileName "assets/cabinet/cabStoveSE.png") 0
|
||||||
modifyMVar_ progress (return . (\(p, _) ->
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
( p + increment
|
( p + increment
|
||||||
, "Loading asset \"cabinet SW\""
|
, "Loading asset \"cabinet SW\""
|
||||||
)))
|
)))
|
||||||
mmiscCabinetSW <- createImage nvg (FileName "assets/cabinet/cabinetSW.png") 0
|
mcabinetSW <- createImage nvg (FileName "assets/cabinet/cabinetSW.png") 0
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading asset \"cabinet SE\""
|
||||||
|
)))
|
||||||
|
mcabinetSE <- createImage nvg (FileName "assets/cabinet/cabinetSE.png") 0
|
||||||
|
modifyMVar_ progress (return . (\(p, _) ->
|
||||||
|
( p + increment
|
||||||
|
, "Loading asset \"cabinet corner\""
|
||||||
|
)))
|
||||||
|
mcabinetCorner <- createImage nvg (FileName "assets/cabinet/cabinetCorner.png") 0
|
||||||
let micons =
|
let micons =
|
||||||
[ mcontrblue, mcontrgreen, marrow
|
[ mcontrblue, mcontrgreen, marrow
|
||||||
]
|
]
|
||||||
|
@ -237,7 +272,10 @@ loadFork ws win glc nvg future progress = do
|
||||||
, mmiscFlipchart
|
, mmiscFlipchart
|
||||||
, mmiscPlant1, mmiscPlant2
|
, mmiscPlant1, mmiscPlant2
|
||||||
, mmiscWatercooler, mmiscVending
|
, mmiscWatercooler, mmiscVending
|
||||||
, mmiscCabCoffee, mmiscCabinetSW
|
, mcabCoffeeSW, mcabCoffeSE
|
||||||
|
, mcabSinkSW, mcabSinkSE
|
||||||
|
, mcabStoveSW, mcabStoveSE
|
||||||
|
, mcabinetSW, mcabinetSE, mcabinetCorner
|
||||||
]
|
]
|
||||||
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"
|
||||||
|
@ -250,7 +288,7 @@ loadFork ws win glc nvg future progress = do
|
||||||
-- (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
|
||||||
.. ImgCabinetSW
|
.. ImgCabinetCorner
|
||||||
]
|
]
|
||||||
mimgs
|
mimgs
|
||||||
icons = zipWith (\a b -> (a, fromJust b))
|
icons = zipWith (\a b -> (a, fromJust b))
|
||||||
|
|
|
@ -99,8 +99,15 @@ instance Collidible ImgId where
|
||||||
collisionObstacle ImgMiscVending =
|
collisionObstacle ImgMiscVending =
|
||||||
[ Boundaries (0, 2/36) (24/36, 34/36)
|
[ Boundaries (0, 2/36) (24/36, 34/36)
|
||||||
]
|
]
|
||||||
collisionObstacle ImgCabinetCoffee = collisionObstacle ImgTableSW
|
collisionObstacle ImgCabinetCoffeeSW = collisionObstacle ImgTableSW
|
||||||
|
collisionObstacle ImgCabinetCoffeeSE = collisionObstacle ImgTableSE
|
||||||
|
collisionObstacle ImgCabinetSinkSW = collisionObstacle ImgTableSW
|
||||||
|
collisionObstacle ImgCabinetSinkSE = collisionObstacle ImgTableSE
|
||||||
|
collisionObstacle ImgCabinetStoveSW = collisionObstacle ImgTableSW
|
||||||
|
collisionObstacle ImgCabinetStoveSE = collisionObstacle ImgTableSE
|
||||||
collisionObstacle ImgCabinetSW = collisionObstacle ImgTableSW
|
collisionObstacle ImgCabinetSW = collisionObstacle ImgTableSW
|
||||||
|
collisionObstacle ImgCabinetSE = collisionObstacle ImgTableSE
|
||||||
|
collisionObstacle ImgCabinetCorner = collisionObstacle ImgTableCorner
|
||||||
collisionObstacle ImgEmptyNoWalk =
|
collisionObstacle ImgEmptyNoWalk =
|
||||||
[ Boundaries (0, 0) (0.99, 0.99) ]
|
[ Boundaries (0, 0) (1, 1) ]
|
||||||
collisionObstacle _ = []
|
collisionObstacle _ = []
|
||||||
|
|
|
@ -35,8 +35,15 @@ data ImgId
|
||||||
| ImgMiscPlant2
|
| ImgMiscPlant2
|
||||||
| ImgMiscWatercooler
|
| ImgMiscWatercooler
|
||||||
| ImgMiscVending
|
| ImgMiscVending
|
||||||
| ImgCabinetCoffee
|
| ImgCabinetCoffeeSW
|
||||||
|
| ImgCabinetCoffeeSE
|
||||||
|
| ImgCabinetSinkSW
|
||||||
|
| ImgCabinetSinkSE
|
||||||
|
| ImgCabinetStoveSW
|
||||||
|
| ImgCabinetStoveSE
|
||||||
| ImgCabinetSW
|
| ImgCabinetSW
|
||||||
|
| ImgCabinetSE
|
||||||
|
| ImgCabinetCorner
|
||||||
-- | ImgIntrNE
|
-- | ImgIntrNE
|
||||||
-- | ImgIntrE
|
-- | ImgIntrE
|
||||||
-- | ImgIntrSE
|
-- | ImgIntrSE
|
||||||
|
|
Loading…
Reference in a new issue