Add basic vocalizations to chase creatures
This commit is contained in:
@@ -2,6 +2,9 @@ module Dodge.PlacementSpot where
|
||||
import Dodge.LevelGen.Data
|
||||
import Geometry
|
||||
|
||||
import Control.Monad.State
|
||||
import System.Random
|
||||
|
||||
-- TODO rename to any unused link facing out
|
||||
anyLnkOutPS :: PlacementSpot
|
||||
anyLnkOutPS = PSLnk f (const id) Nothing
|
||||
@@ -21,3 +24,15 @@ anyLnkInPS x = PSLnk f (const id) Nothing
|
||||
where
|
||||
f (UnusedLink v a) = Just $ PS (v -.- x *.* unitVectorAtAngle (a + 0.5 * pi)) (a+ pi)
|
||||
f _ = Nothing
|
||||
|
||||
useLnkRoomPos :: RoomPos -> Maybe PlacementSpot
|
||||
useLnkRoomPos rp = case rp of
|
||||
(UnusedLink (V2 x y) a) -> Just $ PS (V2 x y) a
|
||||
_ -> Nothing
|
||||
|
||||
psRandRanges :: (Float,Float) -> (Float,Float) -> (Float,Float) -> State StdGen (Point2,Float)
|
||||
psRandRanges xranges yranges aranges = do
|
||||
x <- state $ randomR xranges
|
||||
y <- state $ randomR yranges
|
||||
a <- state $ randomR aranges
|
||||
return (V2 x y,a)
|
||||
|
||||
Reference in New Issue
Block a user