foo
This commit is contained in:
parent
2520ca3cf2
commit
e8847f2aa0
2 changed files with 6 additions and 6 deletions
|
@ -7,7 +7,7 @@ import Data.Ecstasy as E
|
||||||
|
|
||||||
import Control.Monad.IO.Class (MonadIO(..))
|
import Control.Monad.IO.Class (MonadIO(..))
|
||||||
import Control.Concurrent.MVar
|
import Control.Concurrent.MVar
|
||||||
import Control.Concurrent (forkIO)
|
import Control.Concurrent (forkOS)
|
||||||
|
|
||||||
import Linear
|
import Linear
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ updateNPCs imgmat rp dt =
|
||||||
else do
|
else do
|
||||||
ttl <- liftIO $ randomRIO (5, 30)
|
ttl <- liftIO $ randomRIO (5, 30)
|
||||||
future <- liftIO $ newEmptyMVar
|
future <- liftIO $ newEmptyMVar
|
||||||
_ <- liftIO $ forkIO $ getPath (fmap floor pos') future rp imgmat
|
_ <- liftIO $ forkOS $ getPath (fmap floor pos') future rp imgmat
|
||||||
return $ unchanged
|
return $ unchanged
|
||||||
{ npcState = Set $ NPCStanding ttl future
|
{ npcState = Set $ NPCStanding ttl future
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import NanoVG hiding (V2(..))
|
||||||
import Control.Monad (when, unless, void)
|
import Control.Monad (when, unless, void)
|
||||||
import Control.Monad.IO.Class (liftIO)
|
import Control.Monad.IO.Class (liftIO)
|
||||||
import Control.Concurrent.MVar
|
import Control.Concurrent.MVar
|
||||||
import Control.Concurrent (forkIO)
|
import Control.Concurrent (forkOS)
|
||||||
|
|
||||||
import Data.Map.Strict as Map
|
import Data.Map.Strict as Map
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
@ -41,7 +41,7 @@ loadMap = do
|
||||||
let fc = FloorConfig
|
let fc = FloorConfig
|
||||||
(20, 20)
|
(20, 20)
|
||||||
[(5,5), (35, 35)]
|
[(5,5), (35, 35)]
|
||||||
(50,75)
|
(50, 50)
|
||||||
(Subsystems _ m) = subsystems ud
|
(Subsystems _ m) = subsystems ud
|
||||||
(mat, gr) <- liftIO $ buildHallFloorIO fc
|
(mat, gr) <- liftIO $ buildHallFloorIO fc
|
||||||
let imgmat = convertTileToImg mat
|
let imgmat = convertTileToImg mat
|
||||||
|
@ -57,7 +57,7 @@ loadMap = do
|
||||||
liftIO $ logIO A.Debug ("number of reachpoints: " ++ show (length rps))
|
liftIO $ logIO A.Debug ("number of reachpoints: " ++ show (length rps))
|
||||||
let nnex = Prelude.filter (\p -> pointType p /= RoomExit) rps
|
let nnex = Prelude.filter (\p -> pointType p /= RoomExit) rps
|
||||||
liftIO $ A.logIO A.Debug $ "number of placed NPCs: " ++ show (length nnex)
|
liftIO $ A.logIO A.Debug $ "number of placed NPCs: " ++ show (length nnex)
|
||||||
npcposs <- placeNPCs inter mat rps gr (length nnex)
|
npcposs <- placeNPCs inter mat rps gr 50 -- (length nnex)
|
||||||
(nws, _) <- liftIO $ yieldSystemT (worldState ud) $ do
|
(nws, _) <- liftIO $ yieldSystemT (worldState ud) $ do
|
||||||
void $ createEntity $ newEntity
|
void $ createEntity $ newEntity
|
||||||
{ pos = Just (V2 20.5 20.5)
|
{ pos = Just (V2 20.5 20.5)
|
||||||
|
@ -68,7 +68,7 @@ loadMap = do
|
||||||
-- ttl <- liftIO $ randomRIO (5, 30)
|
-- ttl <- liftIO $ randomRIO (5, 30)
|
||||||
fact <- liftIO $ randomRIO (0.5, 1.5)
|
fact <- liftIO $ randomRIO (0.5, 1.5)
|
||||||
future <- liftIO $ newEmptyMVar
|
future <- liftIO $ newEmptyMVar
|
||||||
_ <- liftIO $ forkIO $ getPath (fmap floor npcpos) future nnex inter
|
_ <- liftIO $ forkOS $ getPath (fmap floor npcpos) future nnex inter
|
||||||
createEntity $ newEntity
|
createEntity $ newEntity
|
||||||
{ pos = Just (V2 (nr + 0.5) (nc + 0.5))
|
{ pos = Just (V2 (nr + 0.5) (nc + 0.5))
|
||||||
, vel = Just (V2 0 0)
|
, vel = Just (V2 0 0)
|
||||||
|
|
Loading…
Reference in a new issue